def initialize_log_handler(log_level):
debug_format_str = (
"[{record.level_name}] {record.channel} {record.func_name} "
"({record.lineno}): {record.message}")
if log_level == logbook.DEBUG:
info_format_str = debug_format_str
else:
info_format_str = (
"[{record.level_name}] {record.channel}: {record.message}")
logbook.StderrHandler(
level=logbook.DEBUG, format_string=debug_format_str
).push_application()
logbook.StderrHandler(
level=logbook.INFO, format_string=info_format_str
).push_application()
评论列表
文章目录