summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
dc8216d)
class EventLoggerAdapter(logging.LoggerAdapter) :
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: str(e))
def process(self, msg, kwargs) :
pp = pprinters.get(msg.type, lambda e: str(e))
#logging.basicConfig(level=logging.DEBUG, stream = sys.stdout)
console = logging.getLogger('minwii.console')
console.setLevel(logging.DEBUG)
#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)
_eventLogger = logging.getLogger('minwii.events')
_eventLogger.setLevel(logging.INFO)
app.run(home)
app.close(home)
app.run(home)
app.close(home)
- msg = "sortie de l'application"
+ console.info("sortie de l'application")
else :
actual_wiimotes = self.WT.get_count()
else :
actual_wiimotes = self.WT.get_count()
+ console.info('chanson : %s', home.songFile)
+ console.info('mode : %s', home.modeSelect.value)
if actual_wiimotes is None :
if actual_wiimotes is None :
- msg = 'chanson : %s\nmode : %s\nHID : souris'
- msg = msg % (home.songFile,
- home.modeSelect.value)
+ console.info('HID : souris')
elif actual_wiimotes == 0 :
elif actual_wiimotes == 0 :
- msg = 'chanson : %s\nmode : %s\nHID : souris (pas de wiimote trouvée)'
- msg = msg % (home.songFile,
- home.modeSelect.value)
+ console.info('HID : souris (pas de wiimote trouvée)')
- msg = 'chanson : %s\nmode : %s\nHID : wiimote %d'
- msg = msg % (home.songFile,
- home.modeSelect.value,
- home.selectedWiimote.value + 1)
-
- console.info(msg)
+ console.info('HID : wiimote %d', home.selectedWiimote.value + 1)
+ #---
return (home.exitApp,
home.songFile,
return (home.exitApp,
home.songFile,
selector.stop()
pygame.event.clear()
EventDispatcher.reset()
selector.stop()
pygame.event.clear()
EventDispatcher.reset()
- if selector.selectedInstrument :
- console.info('instrument : %(name)s\npreset : %(preset)d\nbank : %(bank)d\najustement octave : %(octave)d' % \
- selector.selectedInstrument)
- return selector.selectedInstrument
+ instru = selector.selectedInstrument
+ if instru :
+ console.info('instrument : %s', instru['name'])
+ console.info('preset : %d', instru['preset'])
+ console.info('bank : %d', instru['bank'])
+ console.info('ajustement octave : %d', instru['octave'])
+ return instru
def runPlayingScreen(self, songFile, playMode, instrumentDescription) :
""" Lance l'écran de jeu principal avec la chanson 'songFile' dans le mode 'playMode'
def runPlayingScreen(self, songFile, playMode, instrumentDescription) :
""" Lance l'écran de jeu principal avec la chanson 'songFile' dans le mode 'playMode'
self.start()
self.fsid = self.sfload(sfPath)
self._octaveAjusts = {}
self.start()
self.fsid = self.sfload(sfPath)
self._octaveAjusts = {}
- console.info('démarrage du synthétiseur\nsoundfont : %s', sfPath)
+ console.info('démarrage du synthétiseur')
+ console.info('soundfont : %s', sfPath)
def __del__(self) :
console.info('arrêt du synthétiseur.')
def __del__(self) :
console.info('arrêt du synthétiseur.')
EventDispatcher.dispatchEvents()
dirty = self.draw(pygame.display.get_surface())
pygame.display.update(dirty)
EventDispatcher.dispatchEvents()
dirty = self.draw(pygame.display.get_surface())
pygame.display.update(dirty)
- clock.tick()#FRAMERATE)
def stop(self) :
self._running = False
def stop(self) :
self._running = False