예제 #1
0
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)]
예제 #2
0
 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))
예제 #3
0
def test_debug():
    debug('testing debug')
예제 #4
0
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)]