lenskit.logging.LoggingConfig#
- class lenskit.logging.LoggingConfig#
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
structlogand/orlogging, which you can configure in any way you wish.- Stability:
- Caller (see Stability Levels).
- stream: Literal['full', 'simple', 'json'] = 'full'#
- file: pathlib.Path | None = None#
- file_format: LogFormat = 'json'#
- 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
verboseoption is provided, rather than passing your verbose option to it, to allow theLK_LOG_LEVELenvironment variable to apply in the absence of a configuration option.
- set_log_file(path, level=None, format='json')#
Configure a log file.
- Parameters:
path (os.PathLike[str])
level (int | None)
format (LogFormat)
- apply()#
Apply the configuration.