=== modified file 'bin/netsvc.py' --- bin/netsvc.py 2009-02-04 17:27:00 +0000 +++ bin/netsvc.py 2009-02-26 06:22:16 +0000 @@ -87,22 +87,6 @@ # add new log level below DEBUG logging.DEBUG_RPC = logging.DEBUG - 1 -class UnicodeFormatter(logging.Formatter): - def __init__(self, fmt=None, datefmt=None): - logging.Formatter.__init__(self, fmt, datefmt) - self._fmt = tools.ustr(self._fmt) - if self.datefmt is not None: - self.datefmt = tools.ustr(self.datefmt) - - def formatTime(self, *args, **kwargs): - return tools.ustr(logging.Formatter.formatTime(self, *args, **kwargs)) - - def formatException(self, *args, **kwargs): - return tools.ustr(logging.Formatter.formatException(self, *args, **kwargs)) - - def format(self, *args, **kwargs): - return tools.ustr(logging.Formatter.format(self, *args, **kwargs)) - def init_logger(): import os from tools.translate import resetlocale @@ -110,7 +94,7 @@ logger = logging.getLogger() # create a format for log messages and dates - formatter = UnicodeFormatter('[%(asctime)s] %(levelname)s:%(name)s:%(message)s', '%a %b %d %Y %H:%M:%S') + formatter = logging.Formatter('[%(asctime)s] %(levelname)s:%(name)s:%(message)s') logging_to_stdout = False if tools.config['syslog']: @@ -121,7 +105,7 @@ release.version)) else: handler = logging.handlers.SysLogHandler('/dev/log') - formatter = UnicodeFormatter("%s %s" % (release.description, release.version) + ':%(levelname)s:%(name)s:%(message)s') + formatter = logging.Formatter("%s %s" % (release.description, release.version) + ':%(levelname)s:%(name)s:%(message)s') elif tools.config['logfile']: # LogFile Handler @@ -173,7 +157,7 @@ class Logger(object): def notifyChannel(self, name, level, msg): - log = logging.getLogger(name) + log = logging.getLogger(tools.ustr(name)) if level == LOG_DEBUG_RPC and not hasattr(log, level): fct = lambda msg, *args, **kwargs: log.log(logging.DEBUG_RPC, msg, *args, **kwargs)