Example #1
0
    def __init__(self, filename):
        FileHandler.__init__(self, filename, mode='w', encoding=None, delay=0)
        self.stream.write('''<html>
    <head>
        <title>WebUI Log</title>
        <script language="javascript">
            function SetPicWidth(obj) {
                iMaxWidth = 800;
                iMinWidth = 100;
                iPicWidth = obj.width;
                if (iPicWidth == iMinWidth) {
                    obj.width = iMaxWidth;
                } else {
                    obj.width = iMinWidth;
                }
            }
        </script>
        <style type="text/css">
            div.debug {background-color:rgb(215,208,183); padding: 5px;}
            div.info {background-color:rgb(149,245,123); padding: 5px;}
            div.warning {background-color:rgb(252,252,142); padding: 5px;}
            div.error {background-color:rgb(253,143,135); padding: 5px;}
        </style>
    </head>
<body>
''')
 def __init__(self, filename, *args, **kwargs):
     # We have to do some tricky stuff to avoid circular imports.  To this end,
     # we pass /dev/null to the parent handler but specify opening to be delayed.
     # Then when we try to first open the file, we join the LOG_ROOT with the
     # passed filename.
     self.filename = filename
     kwargs['delay'] = True
     BaseFileHandler.__init__(self, "/dev/null", *args, **kwargs)
Example #3
0
 def __init__(self, filename, mode='a', encoding=None, delay=0):
     """
     Use the specified filename for streamed logging
     """
     if codecs is None:
         encoding = None
     FileHandler.__init__(self, filename, mode, encoding, delay)
     self.mode = mode
     self.encoding = encoding
     self.suffix = "%Y-%m-%d"
     self.suffix_time = ""
Example #4
0
 def __init__(self, *args, **kwargs):
     FileHandler.__init__(self, *args, **kwargs)
     self.exception = None
Example #5
0
 def __init__(self, filename, *args, **kwargs):
     self.filename = filename
     kwargs['delay'] = True
     FileHandler.__init__(self, "/dev/null", *args, **kwargs)
Example #6
0
 def __init__(self, filename, mode='a', encoding=None, delay=0):
     filename = _relativeToLogPath(filename)
     FileHandler.__init__(self, filename, mode, encoding, delay)
Example #7
0
 def __init__(self, filename, mode='a', encoding='utf-8', delay=False):
     FileHandler.__init__(self, filename, mode, encoding, delay)
     self.mode = mode
     self.encoding = encoding
     self.suffix = "%Y-%m-%d"
     self.suffix_time = ""
Example #8
0
 def __init__(self, file_path, mode="a", encoding="utf8", delay=True):
     directory_path = dirname(file_path)
     self._storage = FileStorage(directory_path)
     # super() raises exception in Python 2.6
     # TypeError: super() argument 1 must be type, not classobj
     LoggingFileHandler.__init__(self, file_path, mode, encoding, delay)
Example #9
0
 def __init__(self, filename, *args, **kwargs):
     self.filename = filename
     kwargs['delay'] = True
     BaseFileHandler.__init__(self, "/dev/null", *args, **kwargs)
Example #10
0
 def __init__(self, filename, backupCount=0, encoding=None, delay=False):
     self._filename = filename
     self._backupCount = backupCount
     self._rotateAt = self._getNextRotateTime()
     self._extMatch = re.compile(r"^\d{4}-\d{2}-\d{2}$")
     FileHandler.__init__(self, filename, 'a', encoding, delay)
Example #11
0
 def __init__(self, filename, mode='a', encoding=None, delay=0):
     self.suffix = "%Y-%m-%d"
     self.suffix_time = self.get_currentTime()
     _filename = filename + '.' + self.suffix_time
     FileHandler.__init__(self, _filename, mode, encoding, delay)
 def __init__(self, filename, mode='a', encoding=None, delay=0):
     filename = _relativeToLogPath(filename)
     FileHandler.__init__(self, filename, mode, encoding, delay)
Example #13
0
 def __init__(self, filename, filesystem):
     self.filename = filename
     self.filesystem = filesystem
     FileHandler.__init__(self, filename)
 def __init__(self, mode="a"):
     IOUtils.create_file_if_not_exists(LOG_FILEPATH)
     FileHandler.__init__(self, LOG_FILEPATH, mode)
Example #15
0
 def __init__(self, filename, mode='a', encoding=None, delay=False):
     FileHandler.__init__(self, filename, mode, encoding, delay)
 def open(self):
     # create a temp file logger to store log entries
     self.fd, self.filename = mkstemp()
     FileHandler.__init__(self, self.filename, 'w', encoding=self.charset)
     self.closed = False
Example #17
0
 def __init__(self, filename, filesystem):
     self.filename = filename
     self.filesystem = filesystem
     FileHandler.__init__(self, filename)
 def open(self):
     # create a temp file logger to store log entries
     self.fd, self.filename = mkstemp()
     FileHandler.__init__(self, self.filename, 'w', encoding=self.charset)
     self.closed = False
Example #19
0
 def __init__(self, file):
     FileHandler.__init__(self, file)
     self.configHash = _ConfigFile.md5sum()