lenskit.logging.worker#
Support for logging from worker processes.
This is internal support code, clients and LensKit implementers can usually ignore it.
Classes
|
Activate (and deactivate) a worker context. |
|
Configuration for worker logging. |
|
- class lenskit.logging.worker.WorkerLogConfig(address, level, authkey=None)#
Bases:
object
Configuration for worker logging.
- 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:
zmq_context (zmq.Context)
config (WorkerLogConfig)
- 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.