Skip to content

Instantly share code, notes, and snippets.

@EdwardIII

EdwardIII/f.py Secret

Last active December 31, 2015 06:19
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 EdwardIII/0d423cdb2a047f6e7855 to your computer and use it in GitHub Desktop.
Save EdwardIII/0d423cdb2a047f6e7855 to your computer and use it in GitHub Desktop.
api = MyApi()
fileh = logging.FileHandler('/tmp/myapp.log', 'a')
fileh.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
fileh.setFormatter(fileh)
api.logger.addHandler(fileh)
api.do_something_that_contains_a_logging_call() # myapp.log gets created, but is empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment