logger.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:nicfit.py 作者: nicfit 项目源码 文件源码
def DEFAULT_LOGGING_CONFIG(level=logging.WARN, format=LOG_FORMAT):
        """Returns a default logging config in dict format.

         Compatible with logging.config.dictConfig(), this default set the root
         logger to `level` with `sys.stdout` console handler using a formatter
         initialized with `format`. A simple 'brief' formatter is defined that
         shows only the message portion any log entries."""
        return {
            "version": 1,
            "formatters": {"generic": {"format": format},
                           "brief": {"format": "%(message)s"},
                          },
            "handlers": {"console": {"class": "logging.StreamHandler",
                                     "level": "NOTSET",
                                     "formatter": "generic",
                                     "stream": "ext://sys.stdout",
                                    },
                        },
            "root": {"level": level,
                     "handlers": ["console"],
                    },
            "loggers": {},
        }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号