X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/blobdiff_plain/f930cbccef5ed34b7b17b9e738458b048d93d1da..778427f99b8ef872b62311cabd40a3c0e24bebde:/src/app/log.py diff --git a/src/app/log.py b/src/app/log.py index ca10200..c1e3286 100755 --- a/src/app/log.py +++ b/src/app/log.py @@ -22,10 +22,10 @@ hiddenEvents = {pygame.MOUSEMOTION:True, class EventLoggerAdapter(logging.LoggerAdapter) : - FORMAT = "%(ticks)-10s %(eventName)-15s %(message)s" + FORMAT = "EVT %(ticks)-10s %(eventName)-15s %(message)s" def process(self, msg, kwargs) : - pp = pprinters.get(msg.type, lambda e: '') + pp = pprinters.get(msg.type, lambda e: str(e)) extra = {} extra['eventType'] = msg.type extra['eventName'] = eventNames[msg.type] @@ -44,7 +44,9 @@ class EventFilter : #logging.basicConfig(level=logging.DEBUG, stream = sys.stdout) console = logging.getLogger('minwii.console') console.setLevel(logging.DEBUG) -console.addHandler(logging.StreamHandler()) +handler = logging.StreamHandler() +handler.setFormatter(logging.Formatter('APP %(message)s')) +console.addHandler(handler) _eventLogger = logging.getLogger('minwii.events') _eventLogger.setLevel(logging.INFO) @@ -55,4 +57,4 @@ _eventLogger.addHandler(_eventHandler) _eventLogger.addFilter(EventFilter()) eventLogger = EventLoggerAdapter(_eventLogger, {}) - +#eventLogger = logging.getLogger('minwii.events')