Register the event before cursor execute and after cursor execute
    to the event listner of the engine.

def trace_engine(engine):
    """Register the event before cursor execute and after cursor execute
    to the event listner of the engine.
    """
    event.listen(engine, 'before_cursor_execute', _before_cursor_execute)
    event.listen(engine, 'after_cursor_execute', _after_cursor_execute)