@staticmethod<EOL><INDENT>def _setup_log_file(log_file):<DEDENT>
if not log_file:<EOL><INDENT>return None<EOL><DEDENT>return open(log_file, '<STR_LIT:wb>')<EOL>
Open a log file if necessary and return the file handle. This will create a file if it does not exist

:param string log_file: Path to a file where the logs should be written to
:return: Handle to the opened log file, if necessary. None otherwise