我想知道关于这 4 个日志级别 INFO 、 WARNING 、 ERROR 、 CRITICAL ,分别在哪种场景适合用哪种日志级别,比如抛出异常、 IO 操作失败使用 ERROR 。
求老司机列举出尽可能多的场景,免得新人迷路。
求老司机列举出尽可能多的场景,免得新人迷路。
1
knightdf Mar 14, 2017 看心情
|
2
freedomSky Mar 14, 2017 |
3
lovepython Mar 14, 2017
日志级别问题,在你个人选择。
你可以针对每个级别,定制不同的 handler ,出现不同的情况引发不同的级别。 |
4
thekoc Mar 15, 2017
Level When it ’ s used
DEBUG Detailed information, typically of interest only when diagnosing problems. INFO Confirmation that things are working as expected. WARNING An indication that something unexpected happened, or indicative of some problem in the near future (e.g. ‘ disk space low ’). The software is still working as expected. ERROR Due to a more serious problem, the software has not been able to perform some function. CRITICAL A serious error, indicating that the program itself may be unable to continue running. https://docs.python.org/3/howto/logging.html |
6
uhayate OP @freedomSky 谢谢。
|