Skip to content

Instantly share code, notes, and snippets.

@zhu327
Created April 20, 2017 03:12
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 zhu327/a8ad127aa4b1dc91566048c23896255c to your computer and use it in GitHub Desktop.
Save zhu327/a8ad127aa4b1dc91566048c23896255c to your computer and use it in GitHub Desktop.
python logging to stdout
import logging, logging.config
import sys
LOGGING = {
'version': 1,
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'stream': sys.stdout,
}
},
'root': {
'handlers': ['console'],
'level': 'INFO'
}
}
logging.config.dictConfig(LOGGING)
logging.info('Hello')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment