Ignore:
Timestamp:
6 Aug 2011, 11:20:16 (13 years ago)
Author:
uli
Message:

Use new logger also for datacenter. These changes were forgotten in
last commit.

File:
1 edited

Legend:

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

    r6578 r6579  
    2828        self._createSubDirs()
    2929
    30     def _setupLogger(self, logger):
    31         """Setup datacenter logger.
    32         """
    33         logdir = os.path.join(self.storage, 'logs')
    34         if not os.path.exists(logdir):
    35             os.mkdir(logdir)
    36         filename = os.path.join(logdir, 'datacenter.log')
    37 
    38         # Create a rotating file handler logger for datacenter.
    39         handler = logging.handlers.RotatingFileHandler(
    40             filename, maxBytes=5*1024**1, backupCount=5)
    41         formatter = logging.Formatter(
    42             '%(asctime)s - %(levelname)s - %(message)s')
    43         handler.setFormatter(formatter)
    44 
    45         # Here we decide, whether our messages will _also_ go to
    46         # application log.
    47         logger.propagate = False
    48         logger.setLevel(logging.DEBUG)
    49         logger.addHandler(handler)
    50         return logger
    51 
    5230    def _createSubDirs(self):
    5331        """Create standard subdirs.
     
    10684        self.storage = path
    10785        self._createSubDirs()
    108         # Adjust logger...
    109         #logger = self.logger
    110         #handlers = logger.handlers
    111         #for handler in handlers:
    112         #    logger.removeHandler(handler)
    113         #self._setupLogger(logger)
    11486        grok.notify(DataCenterStorageMovedEvent(self))
    11587        return not_copied
Note: See TracChangeset for help on using the changeset viewer.