code: def logging_levels():
      
      enabled = strtobool(request.headers.get("x-request-debug", "false"))
      level = None
      try:
          if enabled:
              level = getLogger().getEffectiveLevel()
              getLogger().setLevel(DEBUG)
          yield
      finally:
          if enabled:
              getLogger().setLevel(level)
docs: Context manager to conditionally set logging levels.
  
      Supports setting per-request debug logging using the `X-Request-Debug` header.