BOSWatch/includes/MyTimedRotatingFileHandler.py
JHCD 30320b3c71 add possibility to start Plugins asynchron
If you are using many Plugins or Plugins with a long execution time you could execute them in an asynchronous manner.
It must be pointed out that enabling (0|1) this consume time, so don't use it for one rapid Plugin.
2015-07-30 18:55:36 +02:00

24 lines
564 B
Python

#!/usr/bin/python
# -*- coding: UTF-8 -*-
#
"""
This Class extended the TimedRotatingFileHandler with the possibility
to change the backupCount after initialization.
@author: Jens Herrmann
"""
import logging
class MyTimedRotatingFileHandler(logging.handlers.TimedRotatingFileHandler):
"""Extended Version of TimedRotatingFileHandler"""
def setBackupCount(self, backupCount):
"""Set/Change backupCount"""
self.backupCount = backupCount
def close(self):
"""Make shure logfile will be flushed"""
self.flush()
super(self.__class__, self).close()