Created
October 27, 2018 16:09
-
-
Save ustun/a8cff6d4125179dbdc2bcb26d48f353a to your computer and use it in GitHub Desktop.
Revisions
-
ustun created this gist
Oct 27, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ import logging import logging.config def configure_logging(): LOG_DIR = "logs/" LOGGING = { "version": 1, "disable_existing_loggers": True, "formatters": { "verbose": { "format": "Logger: %(name)s %(levelname)s %(asctime)s %(module)s %(process)d %(thread)d [%(filename)s:%(lineno)s - %(funcName)20s() ] %(message)s" }, "simple": {"format": "%(levelname)s %(asctime)s %(message)s"}, "only_message": {"format": "%(message)s"}, }, "handlers": { "file": { "level": "INFO", "class": "logging.FileHandler", "filename": LOG_DIR + "logs.log", "formatter": "verbose", }, "console": { "level": "DEBUG", "class": "logging.StreamHandler", "formatter": "simple", }, }, "root": {"level": "DEBUG", "handlers": ["file", "console"]}, } logging.config.dictConfig(LOGGING)