logger
Logger implementations for the coding experiments library.
This module provides concrete implementations of the TransmissionLogger protocol for logging transmission events with different storage and output strategies.
- class codinglab.logger.PlainLogger[source]
Bases:
TransmissionLoggerSimple logger that stores all log entries in memory.
This logger maintains an in-memory list of all transmission logs, which can be accessed later for analysis or debugging.
- logs: List[TransmissionLog]
List of all logged transmission entries.
- log(log_entry)[source]
Store a transmission log entry in memory.
- Parameters:
log_entry (
TransmissionLog) – The transmission log entry to record- Return type:
- class codinglab.logger.ConsoleLogger(verbose=True)[source]
Bases:
TransmissionLoggerLogger that prints log entries to the console.
This logger outputs transmission events to standard output, making it useful for real-time monitoring and debugging.
- Parameters:
verbose (bool)
- __init__(verbose=True)[source]
Initialize a ConsoleLogger.
- Parameters:
verbose (
bool) – Whether to print detailed log information- Return type:
None
- verbose
Verbosity setting for log output.
- log(log_entry)[source]
Print a transmission log entry to the console.
- Parameters:
log_entry (
TransmissionLog) – The transmission log entry to print- Return type:
- class codinglab.logger.NullLogger[source]
Bases:
TransmissionLoggerLogger that discards all log entries (no-op).
This logger implements the TransmissionLogger protocol but performs no actual logging. It’s useful for performance optimization when logging is not required.
- log(log_entry)[source]
Discard a transmission log entry (no operation).
- Parameters:
log_entry (
TransmissionLog) – The transmission log entry to discard- Return type: