mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2025-12-06 07:42:03 +01:00
24 lines
562 B
Python
24 lines
562 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()
|