Skip to content

Instantly share code, notes, and snippets.

@mydreambei-ai
Created April 22, 2020 07:19
Show Gist options
  • Save mydreambei-ai/007d6885d977ba00f0770078b28e7fe1 to your computer and use it in GitHub Desktop.
Save mydreambei-ai/007d6885d977ba00f0770078b28e7fe1 to your computer and use it in GitHub Desktop.
import logging
import logging.config
logging_config = dict(
version=1,
formatters={'f': {
'format': '%(asctime)s %(name)-12s %(levelname)-8s %(message)s'
}},
handlers={'h': {
'class': 'logging.StreamHandler',
'formatter': 'f',
'level': logging.DEBUG
}},
root={
'handlers': ['h'],
'level': logging.INFO,
},
)
logging.config.dictConfig(logging_config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment