elm.ords.utilities.queued_logging.LogListener

class LogListener(logger_names, level='INFO')[source]

Bases: object

Class to listen to logging queue from coroutines and write to files.

Parameters:
  • logger_names (iterable) – An iterable of string, where each string is a logger name. The logger corresponding to each of the names will be equipped with a logging queue handler.

  • level (str, optional) – Log level to set for each logger. By default, "INFO".

Methods

addHandler(handler)

Add a handler to the queue listener.

removeHandler(handler)

Remove a handler from the queue listener.

addHandler(handler)[source]

Add a handler to the queue listener.

Logs that are sent to the queue will be emitted to the handler.

Parameters:

handler (logging.Handler) – Log handler to parse log records.

removeHandler(handler)[source]

Remove a handler from the queue listener.

Logs that are sent to the queue will no longer be emitted to the handler.

Parameters:

handler (logging.Handler) – Log handler to remove from queue listener.