Add method for loggin log_events to a file.
Cleaning up based on pylint results.