码迷,mamicode.com
首页 > 编程语言 > 详细

python3 之logging模块

时间:2018-09-30 14:50:22      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:call   example   between   led   pytho   log   fun   lse   and   

logging.getLogger(name=None)
Return a logger with the specified name or, if name is None, return a logger which is the root logger of the hierarchy.
If specified, the name is typically a dot-separated hierarchical name like ‘a’, ‘a.b’.
All calls to this function with a given name return the same logger instance.
This means that logger instances never need to be passed between different parts of an application

RotatingFileHandler(filename, mode=‘a‘, maxBytes=0, backupCount=0, encoding=None, delay=False)
but if either of maxBytes or backupCount is zero, rollover never occurs,
so you generally want to set backupCount to at least 1, and have a non-zero maxBytes.
For example, with a backupCount of 5 and a base file name of app.log,
you would get app.log, app.log.1, app.log.2, up to app.log.5. The file being written to is always app.log.
When this file is filled, it is closed and renamed to app.log.1,
and if files app.log.1, app.log.2, etc. exist, then they are renamed to app.log.2, app.log.3 etc. respectively.

python3 之logging模块

标签:call   example   between   led   pytho   log   fun   lse   and   

原文地址:https://www.cnblogs.com/zxpo/p/9728928.html

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