Skip to content

Instantly share code, notes, and snippets.

@jimjh
Created January 4, 2015 05:57
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 jimjh/4c61cb6a4c47e36a0d1c to your computer and use it in GitHub Desktop.
Save jimjh/4c61cb6a4c47e36a0d1c to your computer and use it in GitHub Desktop.
Basic Python Logging
import logging
def do_work():
logging.debug("x")
if __name__ == '__main__':
# Register STDOUT as a log handler.
# There are other ways to register handlers, but this is the simplest way.
# See https://docs.python.org/2/library/logging.html#logging.basicConfig
logging.basicConfig(level=logging.DEBUG)
do_work()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment