码迷,mamicode.com
首页 > 编程语言 > 详细

python学习第五十二天logging模块的使用

时间:2018-10-18 01:02:49      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:记录   怎么   python   and   level   www   很多   使用   警告   

   很多程序都有记录日志的需求,并且日志包含的信息即有正常的程序访问日志,还可能有错误,警告等信息输出,python的

logging模块提供了标准的日志接口,你可以通过它存储各种格式的日志,logging的日志可以分debug(),info()

warning() error() and critical()个级别,下面我们看一下怎么用

import logging

logging.warning("www.96net.com.cn")

logging,critical("www.dc3688.com")

logging.info("so this is good")

logging.debug("this is should go to file")

这里的info 等于level 等级

 

python学习第五十二天logging模块的使用

标签:记录   怎么   python   and   level   www   很多   使用   警告   

原文地址:https://www.cnblogs.com/96net/p/9807320.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!