amend resp. restore of change from 59c35bc44a (gh-129):

- logging of "Log rotation detected" with new MSG level
- introduces new log-level MSG (as INFO-2, 18)
pull/1736/head
sebres 2017-03-27 11:27:41 +02:00
parent 52c1950371
commit e8596cfce7
2 changed files with 3 additions and 1 deletions

View File

@ -34,7 +34,9 @@ Below derived from:
https://mail.python.org/pipermail/tutor/2007-August/056243.html https://mail.python.org/pipermail/tutor/2007-August/056243.html
""" """
logging.MSG = logging.INFO - 2
logging.NOTICE = logging.INFO + 5 logging.NOTICE = logging.INFO + 5
logging.addLevelName(logging.MSG, 'MSG')
logging.addLevelName(logging.NOTICE, 'NOTICE') logging.addLevelName(logging.NOTICE, 'NOTICE')

View File

@ -820,7 +820,7 @@ class FileContainer:
## sys.stdout.flush() ## sys.stdout.flush()
# Compare hash and inode # Compare hash and inode
if self.__hash != myHash or self.__ino != stats.st_ino: if self.__hash != myHash or self.__ino != stats.st_ino:
logSys.info("Log rotation detected for %s" % self.__filename) logSys.log(logging.MSG, "Log rotation detected for %s" % self.__filename)
self.__hash = myHash self.__hash = myHash
self.__ino = stats.st_ino self.__ino = stats.st_ino
self.__pos = 0 self.__pos = 0