1. 程式人生 > >三十五 logging

三十五 logging

ica color nbsp ogg mes 設置 clas log gin

1 demo

import logging

# log level:
# DEBUG
# INFO
# Warning
# Error
# CRITICAL

logging.basicConfig(filename
= "test.log", level=logging.DEBUG) // 配置: 設置log的輸出文件和級別 logging.error("error message") logging.warning("warning message") logging.info("info message")

2

三十五 logging