Ignore:
Timestamp:
25 Aug 2011, 10:10:41 (13 years ago)
Author:
uli
Message:

Set default level for loggers.

File:
1 edited

Legend:

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

    r6580 r6624  
    8686from waeup.sirp.interfaces import IDataCenter, IDataCenterStorageMovedEvent
    8787
    88 #: Default logfile size
     88#: Default logfile size (5 KB)
    8989MAX_BYTES = 5 * 1024 ** 2
    9090
    91 #: Default num of backup files
     91#: Default num of backup files (5)
    9292BACKUP_COUNT = 5
     93
     94#: Default logging level (`logging.INFO')
     95LEVEL = logging.INFO
    9396
    9497class ILogger(Interface):
     
    197200        handler = logging.handlers.RotatingFileHandler(
    198201            filename, maxBytes=MAX_BYTES, backupCount=BACKUP_COUNT)
     202        handler.setLevel(LEVEL)
    199203        formatter = logging.Formatter(
    200204            '%(asctime)s - %(levelname)s - %(message)s')
     
    205209        logger.propagate = False
    206210        logger.addHandler(handler)
     211        logger.setLevel(LEVEL)
    207212        return logger
    208213
Note: See TracChangeset for help on using the changeset viewer.