2015-06-25 21:19:41 +02:00
|
|
|
#!/usr/bin/python
|
2015-07-13 10:19:45 +02:00
|
|
|
# -*- coding: UTF-8 -*-
|
2015-06-25 21:19:41 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
"""
|
2015-07-02 09:02:49 +02:00
|
|
|
This Class extended the TimedRotatingFileHandler with the possibility
|
2015-06-25 21:19:41 +02:00
|
|
|
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"""
|
2015-07-02 09:02:49 +02:00
|
|
|
self.backupCount = backupCount
|
2016-10-02 21:28:04 +02:00
|
|
|
|
2015-07-30 18:55:36 +02:00
|
|
|
def close(self):
|
|
|
|
|
"""Make shure logfile will be flushed"""
|
|
|
|
|
self.flush()
|
|
|
|
|
super(self.__class__, self).close()
|