X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/blobdiff_plain/9096acac0bf12c658183483be6dc898db1a31756..778427f99b8ef872b62311cabd40a3c0e24bebde:/src/app/log.py?ds=sidebyside diff --git a/src/app/log.py b/src/app/log.py index ffcf4c6..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)