Logging Utilities#

Logging configuration and utilities.

Logging utilities for the dash-evals runner.

Provides file and console logging for tracing runner execution.

class dash_evals.utils.logging.TeeStream[source]#

Bases: object

A stream that writes to both the original stream and a file.

__init__(original, log_file)[source]#
Parameters:
write(text)[source]#

Write to both streams.

Return type:

int

Parameters:

text (str)

flush()[source]#

Flush both streams.

Return type:

None

fileno()[source]#

Return the file descriptor of the original stream.

Return type:

int

isatty()[source]#

Return whether the original stream is a tty.

Return type:

bool

dash_evals.utils.logging.capture_output(log_file_path)[source]#

Context manager to capture stdout/stderr to a log file.

Parameters:

log_file_path (Path) – Path to the log file to append output to.

Yields:

None - stdout/stderr are captured during the context.

dash_evals.utils.logging.setup_logging(log_dir, name='dash_evals')[source]#

Configure logging to both console and file.

Parameters:
  • log_dir (Path) – Directory to write log files

  • name (str) – Logger name (default: dash_evals)

Return type:

tuple[Logger, Path]

Returns:

Tuple of (configured logger instance, log file path)