Last active
May 30, 2018 08:28
-
-
Save soaxelbrooke/c359bbcf26a56f1198f23e687919dc56 to your computer and use it in GitHub Desktop.
A sensible default logging setup for Python
This file contains hidden or 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
logging.basicConfig(format='%(levelname)s:%(asctime)s.%(msecs)03d [%(threadName)s] - %(message)s', | |
datefmt='%Y-%m-%d,%H:%M:%S', | |
level=getattr(logging, os.getenv('LOG_LEVEL', 'INFO'))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment