from logging.config import dictConfig def setup_logging(): dictConfig({ 'version': 1, 'formatters': { 'default': { 'format': '[%(asctime)s] %(levelname)s in %(module)s: %(message)s', } }, "handlers": { "console": { "class": "logging.StreamHandler", "stream": "ext://sys.stdout", "formatter": "default", } }, 'root': { 'level': 'INFO', 'handlers': ['console'], }, })