码迷,mamicode.com
首页 > 其他好文 > 详细

11-LOG/01.py /

时间:2021-04-01 13:06:35      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:table   level   图片   技术   code   blob   inner   sage   orm   

技术图片

 

 

import logging
   
  LOG_FORMAT = "%(asctime)s=====%(levelname)s++++++%(message)s"
   
  logging.basicConfig(filename="tulingxueyuan.log", level=logging.DEBUG, format=LOG_FORMAT)
   
  logging.debug("This is a debug log.")
  logging.info("This is a info log.")
  logging.warning("This is a warning log.")
  logging.error("This is a error log.")
  logging.critical("This is a critical log.")
   
   
   
   
   
  # 另外一种写法
  logging.log(logging.DEBUG, "This is a debug log.")
  logging.log(logging.INFO, "This is a info log.")
  logging.log(logging.WARNING, "This is a warning log.")
  logging.log(logging.ERROR, "This is a error log.")
  logging.log(logging.CRITICAL, "This is a critical log.")

11-LOG/01.py /

标签:table   level   图片   技术   code   blob   inner   sage   orm   

原文地址:https://www.cnblogs.com/huanhuandomingo/p/14601795.html

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