`
mlzboy
  • 浏览: 704559 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

python logging usage

阅读更多
when you use some third part library,you want to print out these libraries debug info may help you dailogous,code as follows:

import logging
from urllib3.connectionpool import log
console = logging.StreamHandler()

console.setLevel(logging.INFO)

formatter = logging.Formatter("%(asctime)s %(levelname)s %(message)s")

console.setFormatter(formatter)

log.addHandler(console)

reference:http://blog.sina.com.cn/s/blog_51294ca50100gc3x.html

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics