Skip to content

Stream Manager

System-wide stream management, root logger control, and exception interception.


StreamManager

Python
StreamManager(parent_logger)

Manages system streams and root logger

attach

Python
attach(level: logLevels, silence_others: bool = False, stream=sys.stdout) -> None

Attach a WrenchCL-formatted stream handler to the root logger

force_markup

Python
force_markup() -> None

Force enable colorful console output with ANSI escape codes

intercept_exceptions

Python
intercept_exceptions(install_hooks: bool = True, std_stream_mode: Literal['none', 'stderr', 'both'] = 'none') -> None

Configure global exception interception and stdout/stderr suppression

redirect_stderr

Python
redirect_stderr() -> None

Redirect stderr through WrenchCL formatting

redirect_stdout

Python
redirect_stdout() -> None

Redirect stdout through WrenchCL formatting

restore_stderr

Python
restore_stderr() -> None

Restore original stderr

restore_stdout

Python
restore_stdout() -> None

Restore original stdout

suppress

Python
suppress(mode: str = 'both') -> None

Apply or change stdout/stderr suppression without altering hooks