LOG_DICT_CONFIG for custom logging

Add LOG_DICT_CONFIG option to achive ability add custom logging. For example, for `colorlog.ColoredFormatter`
This commit is contained in:
w-495 2016-11-27 03:11:52 +03:00 committed by GitHub
parent a07400ce0a
commit da9c1bf171
1 changed files with 2 additions and 1 deletions

View File

@ -87,7 +87,8 @@ def configure_logging(settings=None, install_root_handler=True):
observer = twisted_log.PythonLoggingObserver('twisted')
observer.start()
dictConfig(DEFAULT_LOGGING)
dictConfig(settings.get('LOG_DICT_CONFIG', DEFAULT_LOGGING))
if isinstance(settings, dict) or settings is None:
settings = Settings(settings)