本文整理汇总了Python中twisted.python.logfile.DailyLogFile.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python DailyLogFile.__init__方法的具体用法?Python DailyLogFile.__init__怎么用?Python DailyLogFile.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.python.logfile.DailyLogFile
的用法示例。
在下文中一共展示了DailyLogFile.__init__方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from twisted.python.logfile import DailyLogFile [as 别名]
# 或者: from twisted.python.logfile.DailyLogFile import __init__ [as 别名]
def __init__(self, name, directory, defaultMode=None,
maxRotatedFiles=None, compressLast=None):
DailyLogFile.__init__(self, name, directory, defaultMode)
if maxRotatedFiles is not None:
self.maxRotatedFiles = int(maxRotatedFiles)
if compressLast is not None:
self.compressLast = int(compressLast)
assert self.compressLast <= self.maxRotatedFiles, (
"Only %d rotate files are kept, cannot compress %d"
% (self.maxRotatedFiles, self.compressLast))
示例2: __init__
# 需要导入模块: from twisted.python.logfile import DailyLogFile [as 别名]
# 或者: from twisted.python.logfile.DailyLogFile import __init__ [as 别名]
def __init__(self, *args, **kwargs):
"""
Create a log file rotating on length.
@param name: file name.
@type name: C{str}
@param directory: path of the log file.
@type directory: C{str}
@param defaultMode: mode used to create the file.
@type defaultMode: C{int}
@param maxRotatedFiles: if not None, max number of log files the class
creates. Warning: it removes all log files above this number.
@type maxRotatedFiles: C{int}
"""
self.maxRotatedFiles = kwargs.pop('maxRotatedFiles', None)
DailyLogFile.__init__(self, *args, **kwargs)
self._logger = logWithContext(type='console')
示例3: __init__
# 需要导入模块: from twisted.python.logfile import DailyLogFile [as 别名]
# 或者: from twisted.python.logfile.DailyLogFile import __init__ [as 别名]
def __init__(self, *args, **kwargs):
DailyLogFile.__init__(self, *args, **kwargs)
# avoid circular dependencies
from carbon.conf import settings
self.enableRotation = settings.ENABLE_LOGROTATION
示例4: __init__
# 需要导入模块: from twisted.python.logfile import DailyLogFile [as 别名]
# 或者: from twisted.python.logfile.DailyLogFile import __init__ [as 别名]
def __init__(self, log_file, log_path):
DailyLogFile.__init__(self, log_file, log_path)