[PEAK] peak.running.logs

Yaroslav Samchuk yarcat at ank-sia.com
Wed Oct 29 12:45:41 EST 2003


Some time ago you fixed the error in peak.running.logs._levelledMessage 
function. It seems, that AbstractLogger.log method was not fixed at that 
time - logger.log(LOG_DEBUG, "%s") fail with "TypeError: not enough 
arguments for format string"

Current implementation is (peak/running/logs.py:370):

     def log(self, lvl, msg, *args, **kwargs):
         if self.level <= lvl:
             self.publish(
                 self.EventClass(
                     (msg % args), self, priority=lvl, **kwargs
                 )
             )


Should be:

     def log(self, lvl, msg, *args, **kwargs):
         if self.level <= lvl:
             if args:
                 msg = msg % args
             self.publish(
                 self.EventClass(msg , self, priority=lvl, **kwargs))


--
Best wishes,
Yaroslav




More information about the PEAK mailing list