当前位置:网站首页>journal
journal
2022-04-23 17:58:00 【Feng Ye 520】
import logging,sys
# obtain logger Example
logger = logging.getLogger("testLoger")
# Appoint logger The output form of
formatter = logging.Formatter("%(asctime)s %(levelname)s %(message)s")
# File log , Terminal log
file_handler = logging.FileHandler('testLogger.log')
# The file log is written in the specified format
file_handler.setFormatter(formatter)
console_handler = logging.StreamHandler(sys.stdout)
# The file log is written in the specified format
console_handler.setFormatter(formatter)
# Log files , Add the terminal log object to the log processor logger in
logger.addHandler(file_handler)
logger.addHandler(console_handler)
logger.warning("test warning in log")
logger.removeHandler(file_handler)
logger.removeHandler(console_handler)
版权声明
本文为[Feng Ye 520]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230546152238.html
边栏推荐
- Oil monkey website address
- Data stream encryption and decryption of C
- Timestamp to formatted date
- C language implements memcpy, memset, strcpy, strncpy, StrCmp, strncmp and strlen
- Auto.js 自定义对话框
- JS high frequency interview questions
- Thirteen documents in software engineering
- How to read literature
- Some questions some questions some questions some questions
- C network related operations
猜你喜欢
2022江西光伏展,中国分布式光伏展会,南昌太阳能利用展
On the problem of V-IF display and hiding
Leak detection and vacancy filling (6)
Detailed deployment of flask project
JS forms the items with the same name in the array object into the same array according to the name
MySQL 中的字符串函数
Gets the time range of the current week
Applet learning notes (I)
Data stream encryption and decryption of C
C#的随机数生成
随机推荐
C language implements memcpy, memset, strcpy, strncpy, StrCmp, strncmp and strlen
Ring back to origin problem - byte jumping high frequency problem
2022 Jiangxi Photovoltaic Exhibition, China Distributed Photovoltaic Exhibition, Nanchang Solar Energy Utilization Exhibition
2022 Jiangxi energy storage technology exhibition, China Battery exhibition, power battery exhibition and fuel cell Exhibition
Utilisation de la liste - Ajouter, supprimer et modifier la requête
C1 notes [task training chapter I]
On the problem of V-IF display and hiding
SQL optimization for advanced learning of MySQL [insert, primary key, sort, group, page, count]
198. Looting - Dynamic Planning
Listen for click events other than an element
C#的随机数生成
Applet learning notes (I)
ES6 new method
Uniapp custom search box adaptation applet alignment capsule
Anchor location - how to set the distance between the anchor and the top of the page. The anchor is located and offset from the top
ES6 face test questions (reference documents)
SystemVerilog(六)-变量
The method of changing a value in the array and a value in the object of wechat applet
Yolov4 pruning [with code]
2022江西储能技术展会,中国电池展,动力电池展,燃料电池展