Skip to content

Instantly share code, notes, and snippets.

@soaxelbrooke
Last active May 30, 2018 08:28
Show Gist options
  • Save soaxelbrooke/c359bbcf26a56f1198f23e687919dc56 to your computer and use it in GitHub Desktop.
Save soaxelbrooke/c359bbcf26a56f1198f23e687919dc56 to your computer and use it in GitHub Desktop.
A sensible default logging setup for Python
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