+
+
+class EventLoggerAdapter(logging.LoggerAdapter) :
+
+ FORMAT = "EVT %(ticks)-10s %(eventName)-15s %(message)s"
+
+ def process(self, msg, kwargs) :
+ pp = pprinters.get(msg.type, lambda e: str(e))
+ extra = {}
+ extra['eventType'] = msg.type
+ extra['eventName'] = eventNames[msg.type]
+ extra['ticks'] = pygame.time.get_ticks()
+ kwargs['extra']=extra
+ return pp(msg), kwargs
+
+class EventFilter :
+
+ def __init__(self):
+ pass
+
+ def filter(self, record) :
+ return not hiddenEvents.has_key(record.eventType)
+
+#logging.basicConfig(level=logging.DEBUG, stream = sys.stdout)
+console = logging.getLogger('minwii.console')
+console.setLevel(logging.DEBUG)
+handler = logging.StreamHandler()
+handler.setFormatter(logging.Formatter('APP %(message)s'))
+console.addHandler(handler)
+
+_eventLogger = logging.getLogger('minwii.events')
+_eventLogger.setLevel(logging.INFO)
+_eventHandler = logging.StreamHandler()
+_eventFormatter = logging.Formatter(EventLoggerAdapter.FORMAT)
+_eventHandler.setFormatter(_eventFormatter)
+_eventLogger.addHandler(_eventHandler)
+_eventLogger.addFilter(EventFilter())
+
+eventLogger = EventLoggerAdapter(_eventLogger, {})
+#eventLogger = logging.getLogger('minwii.events')