Created
February 15, 2017 17:02
-
-
Save jeffbrl/d51757d2c28197d47d227b1180e3427a to your computer and use it in GitHub Desktop.
My preferred python logging module configuration and usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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