def log_context(trace_level, stream):
    '''
    To be used to temporarily change the logging settings.
    '''
    original_trace_level = DebugInfoHolder.DEBUG_TRACE_LEVEL
    original_stream = DebugInfoHolder.DEBUG_STREAM

    DebugInfoHolder.DEBUG_TRACE_LEVEL = trace_level
    DebugInfoHolder.DEBUG_STREAM = stream
    try:
        yield
    finally:
        DebugInfoHolder.DEBUG_TRACE_LEVEL = original_trace_level
        DebugInfoHolder.DEBUG_STREAM = original_stream
def log_context ( trace_level , stream ) : original_trace_level = DebugInfoHolder . DEBUG_TRACE_LEVEL original_stream = DebugInfoHolder . DEBUG_STREAM DebugInfoHolder . DEBUG_TRACE_LEVEL = trace_level DebugInfoHolder . DEBUG_STREAM = stream try : yield finally : DebugInfoHolder . DEBUG_TRACE_LEVEL = original_trace_level DebugInfoHolder . DEBUG_STREAM = original_stream
To be used to temporarily change the logging settings.