Changeset 6580


Ignore:
Timestamp:
7 Aug 2011, 12:40:01 (13 years ago)
Author:
uli
Message:

Log to commandline while site not added to ZODB.

File:
1 edited

Legend:

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

    r6578 r6580  
    165165        """
    166166        site = grok.getSite()
    167         sitename = '%s' % getattr(site, '__name__', None)
     167        sitename = getattr(site, '__name__', None)
    168168        loggername = Template(self.logger_name).substitute(
    169             dict(sitename=sitename))
     169            dict(sitename='%s' % sitename))
    170170        logger = logging.getLogger(loggername)
    171         if site is None:
     171        if site is None or sitename is None:
     172            # Site not added to ZODB yet. Log to commandline
    172173            return logger
    173174        if len(logger.handlers) != 1:
Note: See TracChangeset for help on using the changeset viewer.