Changeset 13776 for main/waeup.kofa/trunk/src
- Timestamp:
- 11 Mar 2016, 11:45:01 (9 years ago)
- 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 78 78 from logging.handlers import WatchedFileHandler 79 79 from string import Template 80 from ulif.loghandlers import DatedRotatingFileHandler81 80 from zope import schema 82 81 from zope.component import queryUtility … … 85 84 IDataCenter, IDataCenterStorageMovedEvent, ILoggerCollector) 86 85 from waeup.kofa.utils.helpers import get_current_principal 87 88 #: Default logfile size (5 KB, not relevant for DatedRotatingFileHandlers)89 MAX_BYTES = 5 * 1024 ** 290 91 #: Default num of backup files (-1 = indefinite)92 BACKUP_COUNT = -193 86 94 87 #: Default logging level (`logging.INFO`) … … 218 211 handler = WatchedFileHandler( 219 212 filename, encoding='utf-8') 220 #handler = DatedRotatingFileHandler(221 # filename, when='MON', backupCount=BACKUP_COUNT)222 213 handler.setLevel(LEVEL) 223 214 formatter = logging.Formatter(self.logger_format_str) -
main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_logger.py
r9988 r13776 29 29 30 30 from waeup.kofa.utils.logger import ( 31 Logger, MAX_BYTES, BACKUP_COUNT,ILoggerCollector, LoggerCollector,31 Logger, ILoggerCollector, LoggerCollector, 32 32 ILogger) 33 33 … … 162 162 self.assertEqual(len(result.handlers), 1) 163 163 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)168 164 self.assertTrue(result.propagate is False) 169 165 return
Note: See TracChangeset for help on using the changeset viewer.