code: 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_streaf 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
docs: To be used to temporarily change the logging settings.