Changeset 13776


Ignore:
Timestamp:
11 Mar 2016, 11:45:01 (9 years ago)
Author:
Henrik Bettermann
Message:

Do not import deprecated DatedRotatingFileHandler?.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/utils
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/logger.py

    r12836 r13776  
    7878from logging.handlers import WatchedFileHandler
    7979from string import Template
    80 from ulif.loghandlers import DatedRotatingFileHandler
    8180from zope import schema
    8281from zope.component import queryUtility
     
    8584    IDataCenter, IDataCenterStorageMovedEvent, ILoggerCollector)
    8685from waeup.kofa.utils.helpers import get_current_principal
    87 
    88 #: Default logfile size (5 KB, not relevant for DatedRotatingFileHandlers)
    89 MAX_BYTES = 5 * 1024 ** 2
    90 
    91 #: Default num of backup files (-1 = indefinite)
    92 BACKUP_COUNT = -1
    9386
    9487#: Default logging level (`logging.INFO`)
     
    218211        handler = WatchedFileHandler(
    219212            filename, encoding='utf-8')
    220         #handler = DatedRotatingFileHandler(
    221         #    filename, when='MON', backupCount=BACKUP_COUNT)
    222213        handler.setLevel(LEVEL)
    223214        formatter = logging.Formatter(self.logger_format_str)
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_logger.py

    r9988 r13776  
    2929
    3030from waeup.kofa.utils.logger import (
    31     Logger, MAX_BYTES, BACKUP_COUNT, ILoggerCollector, LoggerCollector,
     31    Logger, ILoggerCollector, LoggerCollector,
    3232    ILogger)
    3333
     
    162162        self.assertEqual(len(result.handlers), 1)
    163163        handler = result.handlers[0]
    164         if hasattr(handler, 'maxBytes'):
    165             self.assertEqual(handler.maxBytes, MAX_BYTES)
    166         if hasattr(handler, 'backupCount'):
    167             self.assertEqual(handler.backupCount, BACKUP_COUNT)
    168164        self.assertTrue(result.propagate is False)
    169165        return
Note: See TracChangeset for help on using the changeset viewer.