lenskit.logging.worker#

Support for logging from worker processes.

This is internal support code, clients and LensKit implementers can usually ignore it.

Classes

WorkerContext(config)

Activate (and deactivate) a worker context.

WorkerLogConfig(address, level[, authkey])

Configuration for worker logging.

ZMQLogHandler(zmq_context, config)

class lenskit.logging.worker.WorkerLogConfig(address, level, authkey=None)#

Bases: object

Configuration for worker logging.

Parameters:
classmethod current()#

Get the current worker logging configuration.

class lenskit.logging.worker.WorkerContext(config)#

Bases: object

Activate (and deactivate) a worker context. This handles setup and teardown of logging, etc.

Only one worker context can be active, regardless of how many threads are active.

Parameters:

config (WorkerLogConfig)

class lenskit.logging.worker.ZMQLogHandler(zmq_context, config)#

Bases: Handler

Parameters:
handle(record)#

Conditionally emit the specified logging record.

Emission depends on filters which may have been added to the handler. Wrap the actual emission of the record with acquisition/release of the I/O thread lock.

Returns an instance of the log record that was emitted if it passed all filters, otherwise a false value is returned.

Parameters:

record (LogRecord)

Return type:

LogRecord | bool