def __init__(self, name, directory, exist_postfix=''): # if isLocked(name): # import os # base, ext = os.path.splitext(name) # name = base + exist_postfix + ext # self._lock = FilesystemLock(name) # self._lock.lock() DailyLogFile.__init__(self, name, directory)
def __init__(self, name, directory, archive_dir, defaultMode=None): """ Create a log file. @param name: name of the file @param directory: directory holding the file @param defaultMode: permissions used to create the file. Default to current permissions of the file if the file exists. """ self.archive_dir = archive_dir DailyLogFile.__init__(self, name, directory, defaultMode=defaultMode)
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))
def __init__(self, name, directory, exist_postfix=''): # if isLocked(name): # import os # base, ext = os.path.splitext(name) # name = base + exist_postfix + ext # self._lock = FilesystemLock(name) # self._lock.lock() try: DailyLogFile.__init__(self, name, directory) except Exception as e: print 'HourLogFile __init__ File error' print traceback.format_exc() print directory
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')
def __init__(self, *args, **kwargs): DailyLogFile.__init__(self, *args, **kwargs) # avoid circular dependencies from carbon.conf import settings self.enableRotation = settings.ENABLE_LOGROTATION
def __init__(self, log_file, log_path): DailyLogFile.__init__(self, log_file, log_path)