Skip to content

Instantly share code, notes, and snippets.

@mydreambei-ai
Last active April 22, 2020 08:37
Show Gist options
  • Save mydreambei-ai/255c46eb3e1060c92e8b68f11b732c25 to your computer and use it in GitHub Desktop.
Save mydreambei-ai/255c46eb3e1060c92e8b68f11b732c25 to your computer and use it in GitHub Desktop.
import logging
import logging.config
import os
logging_config = dict(
version=1,
disable_existing_loggers=False,
formatters={'f': {
'format': '%(asctime)s %(name)-12s %(levelname)-8s %(message)s'
}},
handlers={'app': {
'class': 'logging.StreamHandler',
'formatter': 'f',
'level': logging.INFO
},
"others": {
'class': 'logging.StreamHandler',
'formatter': 'f',
'level': logging.DEBUG
}},
loggers = {"A.B.C": {
'handlers': ['app'],
'propagate': False
}},
root={
'handlers': ['others'],
'level': logging.DEBUG,
},
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment