decent_bench.utils.logger#

decent_bench.utils.logger.LOGGER#

Logger to be used across the codebase.

class decent_bench.utils.logger.LogQueue(*args, **kwargs)[source]#

Bases: Protocol

A minimal protocol for queue-like objects used by logging handlers.

abstractmethod put_nowait(item: LogRecord, /) None[source]#

Put item.

abstractmethod get() LogRecord[source]#

Get item.

decent_bench.utils.logger.start_log_listener(manager: SyncManager, log_level: int) QueueListener[source]#

Start listener thread which can receive log messages through a queue.

Parameters:
  • manager – used to create a log queue that can be shared across processes

  • log_level – minimum level to log, e.g. logging.INFO

Returns:

QueueListener which can be used to access the log queue and to stop the listener thread

decent_bench.utils.logger.start_queue_logger(queue: LogQueue) None[source]#

Configure the default logger for the current process to put log messages in the queue.