当前位置:网站首页>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
边栏推荐
- MySQL进阶学习之SQL优化【插入,主键,排序,分组,分页,计数】
- 386. Dictionary order (medium) - iteration - full arrangement
- I / O multiplexing and its related details
- Detailed deployment of flask project
- Realsense selection comparison d455 d435i d415 t265 3D hardware comparison
- Where is the configuration file of tidb server?
- On the method of outputting the complete name of typeID from GCC
- vite配置proxy代理解决跨域
- Tell the truth of TS
- Error in created hook: "referenceerror:" promise "undefined“
猜你喜欢
SystemVerilog (VI) - variable
Using files to save data (C language)
Index: teach you index from zero basis to proficient use
Examination question bank and online simulation examination of the third batch (main person in charge) of special operation certificate of safety officer a certificate in Guangdong Province in 2022
Fashion classification case based on keras
Summary of floating point double precision, single precision and half precision knowledge
Qtablewidget usage explanation
.104History
.105Location
Classification of cifar100 data set based on convolutional neural network
随机推荐
极致体验,揭晓抖音背后的音视频技术
Halo open source project learning (II): entity classes and data tables
C language loop structure program
Special effects case collection: mouse planet small tail
Romance in C language
Some questions some questions some questions some questions
QTableWidget使用讲解
JS get link? The following parameter name or value, according to the URL? Judge the parameters after
[appium] write scripts by designing Keyword Driven files
Clion installation tutorial
Leak detection and vacancy filling (VIII)
The JS timestamp of wechat applet is converted to / 1000 seconds. After six hours and one day, this Friday option calculates the time
2022 Shanghai safety officer C certificate operation certificate examination question bank and simulation examination
SystemVerilog(六)-变量
Flask项目的部署详解
Summary of floating point double precision, single precision and half precision knowledge
开源按键组件Multi_Button的使用,含测试工程
JS implementation private attribute
Client example analysis of easymodbustcp
2022制冷与空调设备运行操作判断题及答案