utils.tee

utils.tee

Utilities for managing the debug log file and providing a file-only stream for logging handlers.

Functions

Name Description
close_debug_log Flush and close the debug log and uninstall the stdout/stderr tee.
prepare_debug_log Prepare the debug log.

close_debug_log

utils.tee.close_debug_log()

Flush and close the debug log and uninstall the stdout/stderr tee.

Safe to call even if not initialized.

prepare_debug_log

utils.tee.prepare_debug_log(cfg, filename='debug.log')

Prepare the debug log.

Creates the output directory, handles append/truncate logic based on cfg, and opens the debug log file for subsequent writes via file-only handlers.