예제 #1
0
 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)
예제 #2
0
    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)
예제 #3
0
    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))
예제 #4
0
파일: log.py 프로젝트: rolllyroman/fish_
 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
예제 #5
0
    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))
예제 #6
0
    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')
예제 #7
0
    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')
예제 #8
0
 def __init__(self, *args, **kwargs):
   DailyLogFile.__init__(self, *args, **kwargs)
   # avoid circular dependencies
   from carbon.conf import settings
   self.enableRotation = settings.ENABLE_LOGROTATION
예제 #9
0
 def __init__(self, *args, **kwargs):
   DailyLogFile.__init__(self, *args, **kwargs)
   # avoid circular dependencies
   from carbon.conf import settings
   self.enableRotation = settings.ENABLE_LOGROTATION
예제 #10
0
 def __init__(self, log_file, log_path):
     DailyLogFile.__init__(self, log_file, log_path)