lenskit.logging.config#

Logging pipeline configuration.

Functions

active_logging_config()

Get the currently-active logging configuration.

Classes

LoggingConfig()

Configuration for LensKit logging.

lenskit.logging.config.active_logging_config()#

Get the currently-active logging configuration.

Return type:

LoggingConfig | None

class lenskit.logging.config.LoggingConfig#

Bases: object

Configuration for LensKit logging.

This class is intended as a convenience for LensKit applications to set up a useful logging and progress reporting configuration; if unconfigured, LensKit will emit its logging messages directly to structlog and/or logging, which you can configure in any way you wish.

set_verbose(verbose=True)#

Enable verbose logging.

Note

It is better to only call this method if your application’s verbose option is provided, rather than passing your verbose option to it, to allow the LK_LOG_LEVEL environment variable to apply in the absence of a configuration option.

Parameters:

verbose (bool | int) – The level of verbosity. Values of True or 1 turn on DEBUG-level logs, and 2 or greater turns on tracing.

log_file(path, level=None)#

Configure a log file.

Parameters:
apply()#

Apply the configuration.