@staticmethod<EOL><INDENT>def _setup_output_file(output_file):<DEDENT>
if not output_file:<EOL><INDENT>return None<EOL><DEDENT>return open(output_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

Parameters
----------
output_file : str
    Path to a file where the logs should be written to

Returns
-------
Handle to the opened log file, if necessary. None otherwise