change_stream_for_all_streamhandlers

change_stream_for_all_streamhandlers(new_stream: IOBase, package_prefix: str | None = None) None[source]

Iterates over existing loggers and updates the stream of their StreamHandlers to the given new_stream.

If package_prefix is provided, only loggers whose names start with the specified prefix will be modified.

Parameters:
  • new_stream -- A file-like object (e.g., an open file, sys.stdout, sys.stderr) to set as the new output stream.

  • package_prefix -- Optional string. If provided, only loggers whose names start with this prefix are considered.

Note: all pipeline-namespace logger are attached to a streamhandler by default, so to capture all debug level logging messages, we ovied the streamhadnler targets here.