Changeset 13810
- Timestamp:
- 6 Apr 2016, 11:25:10 (9 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/utils
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/utils/logger.py
r12839 r13810 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.ikoba.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.ikoba/trunk/src/waeup/ikoba/utils/tests/test_logger.py
r11954 r13810 29 29 30 30 from waeup.ikoba.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.