logging.debug('这是一条debug,开始使用日志啦') logging.info('这是一条info,开始使用日志啦') logging.warning('这是一条warning,开始使用日志啦') logging.error("这是一条error,开始使用日志啦") logging.critical("这是一条critical告,开始使用日志啦") bebug:详细信息,通常仅在诊断问题时感兴趣。 info:确认时间按预期工作。 warning:表示意外发生,或表示在不就将来出现一些问题(例
在部署项目时,不可能直接将所有的信息都输出到控制台中,我们可以将这些信息记录到日志文件中,这样不仅方便我们查看程序运行时的情况,也可以在项目出现故障时根据运行时产生的日志快速定位问题出现的位置。
2.7.9-6 python-base - 2.7.9-6 python-codecs - 2.7.9-6 python-compiler - 2.7.9-6 python-light - 2.7.9-6 python-logging
blog/1162698 《python logging现学现用 – TimedRotatingFileHandler使用方法》http://openexz.sinaapp.com/2011/10/12/python-logging
asctime)s %(name)s %(levelname)s %(filename)s-%(lineno)d:%(message)s"formatter = logging.Formatter(fmt)在python-logging
asctime)s %(name)s %(levelname)s %(filename)s-%(lineno)d:%(message)s"formatter = logging.Formatter(fmt)在python-logging