Skip to content

Instantly share code, notes, and snippets.

@snahor
Created February 3, 2010 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snahor/294105 to your computer and use it in GitHub Desktop.
Save snahor/294105 to your computer and use it in GitHub Desktop.
# Including logging
log_file = who_args.pop('log_file', None)
if log_file is not None:
if log_file.lower() == 'stdout':
log_stream = sys.stdout
elif log_file.lower() == 'stderr':
log_stream = sys.stderr
else:
log_stream = open(log_file, 'wb')
who_args['log_stream'] = log_stream
log_level = who_args.get('log_level', None)
if log_level is None:
log_level = logging.INFO
else:
log_level = _LEVELS[log_level.lower()]
who_args['log_level'] = log_level
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment