lenskit.logging.config#
Logging pipeline configuration.
Functions
Get the currently-active logging configuration. |
|
|
Simple one-function logging configuration for simple command lines. |
|
Simple one-function logging configuration for notebooks and similar. |
Classes
Configuration for LensKit logging. |
- lenskit.logging.config.active_logging_config()#
Get the currently-active logging configuration.
- Stability:
- Internal (see Stability Levels).
- Return type:
LoggingConfig | None
- lenskit.logging.config.basic_logging(level=20)#
Simple one-function logging configuration for simple command lines.
- Stability:
- Caller (see Stability Levels).
- Parameters:
level (int)
- lenskit.logging.config.notebook_logging(level=20)#
Simple one-function logging configuration for notebooks and similar.
- Stability:
- Caller (see Stability Levels).
- Parameters:
level (int)
- 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/orlogging
, which you can configure in any way you wish.- Stability:
- Caller (see Stability Levels).
- set_stream_mode(mode)#
Configure the standard error stream mode.
- Parameters:
mode (Literal['full', 'simple', 'json'])
- 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 theLK_LOG_LEVEL
environment variable to apply in the absence of a configuration option.
- set_log_file(path, level=None, format='json')#
Configure a log file.
- apply()#
Apply the configuration.