def emit_event(event, *args, **kwargs): """Emit a event and return a `EventResult` instance.""" app = local.application if event != 'log': debug('Emit: %s (%s)' % (event, ', '.join(map(repr, args)))) return [x(*args, **kwargs) for x in app.events.iter(event)]
def _wrap(*args, **kwargs): start_time = time.time() try: return func(*args, **kwargs) finally: total_time = time.time() - start_time log.debug("timed: function call %r in %r took %f seconds." % (func.__name__, func.__module__, total_time))
def test_debug(): debug('testing debug')
def emit_event(event, *args, **kwargs): """Emit an event and return an `EventResult` instance.""" app = local.application if event != "log": debug("Emit: %s (%s)" % (event, ", ".join(map(repr, args)))) return [x(*args, **kwargs) for x in app.events.iter(event)]