Skip to content

Instantly share code, notes, and snippets.

@jeffbrl
Created February 15, 2017 17:02
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 jeffbrl/d51757d2c28197d47d227b1180e3427a to your computer and use it in GitHub Desktop.
Save jeffbrl/d51757d2c28197d47d227b1180e3427a to your computer and use it in GitHub Desktop.
My preferred python logging module configuration and usage
import logging
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG,
format='%(asctime)s.%(msecs)d %(levelname)s %(module)s - %(funcName)s: %(message)s',
datefmt="%Y-%m-%d %H:%M:%S")
logging.debug("Here is a debug-level message")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment