Added logging to its own class and fixed bugs in files.py.