logging简单配置

韦宏朗
2023-12-01
import logging
format_str = '%(filename)s(line %(lineno)s)\t%(levelname)s -- %(message)s'
logging.basicConfig(level=logging.ERROR, format=format_str)
logger = logging.getLogger(__name__)

logger.setLevel(logging.INFO)  #logs info and higher

 

 类似资料: