本文整理汇总了Python中logging.handlers.WatchedFileHandler.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python WatchedFileHandler.__init__方法的具体用法?Python WatchedFileHandler.__init__怎么用?Python WatchedFileHandler.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logging.handlers.WatchedFileHandler
的用法示例。
在下文中一共展示了WatchedFileHandler.__init__方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from logging.handlers import WatchedFileHandler [as 别名]
# 或者: from logging.handlers.WatchedFileHandler import __init__ [as 别名]
def __init__(self, *args, **kwargs):
WatchedFileHandler.__init__(self, *args, **kwargs)
def reopenLog(signal, frame):
"""the signal handler"""
self.reopen_stream()
signal.signal(signal.SIGUSR1, reopenLog)
示例2: __init__
# 需要导入模块: from logging.handlers import WatchedFileHandler [as 别名]
# 或者: from logging.handlers.WatchedFileHandler import __init__ [as 别名]
def __init__(self, filename, umask=0112):
if not isinstance(filename, basestring):
raise ValueError('filename must be a string, got %r' % filename)
self.umask = umask
old_umask = os.umask(self.umask)
try:
# This does not work on py 2.6
# WatchedFileHandler is probably old style class in 2.6
# super(UmaskWatchedFileHandler, self).__init__(filename)
WatchedFileHandler.__init__(self, filename)
finally:
os.umask(old_umask)
示例3: __init__
# 需要导入模块: from logging.handlers import WatchedFileHandler [as 别名]
# 或者: from logging.handlers.WatchedFileHandler import __init__ [as 别名]
def __init__(self, filename, mode='a', encoding="utf-8", delay=0, pattern=None):
"""Initialize the FilteredFileHandler object."""
self.pattern = pattern
WatchedFileHandler.__init__(self, filename, mode=mode, encoding=encoding, delay=delay)
示例4: __init__
# 需要导入模块: from logging.handlers import WatchedFileHandler [as 别名]
# 或者: from logging.handlers.WatchedFileHandler import __init__ [as 别名]
def __init__(self, filename, mode="a", encoding=None, delay=0):
WatchedFileHandler.__init__(self, filename, mode, encoding, delay)
self._lock = RLock()
示例5: __init__
# 需要导入模块: from logging.handlers import WatchedFileHandler [as 别名]
# 或者: from logging.handlers.WatchedFileHandler import __init__ [as 别名]
def __init__(self):
WatchedFileHandler.__init__(self, self.__get_logfile_name())
self.setLevel(logging.INFO)
self.setFormatter(logging.Formatter(tornado.options.options.logformat))
示例6: __init__
# 需要导入模块: from logging.handlers import WatchedFileHandler [as 别名]
# 或者: from logging.handlers.WatchedFileHandler import __init__ [as 别名]
def __init__(self, filename):
WatchedFileHandler.__init__(self, filename, encoding='utf-8')