Cli Logger Adapter Class#
- class expectmine.logger.adapters.cli_logger_adapter.CliLoggerAdapter(log_level: LogLevel, write_logfile: bool, **kwargs: Dict[Any, Any])[source]#
Bases:
BaseLoggerAdapterCliLogger Adapter for CliLogging.
- __init__(log_level: LogLevel, write_logfile: bool, **kwargs: Dict[Any, Any])[source]#
Creates a factory for producing scoped loggers.
- Parameters:
log_level (LogLevel) β The minimal logging priority that should be logged.
write_logfile (bool) β Boolean indicating weather logs should be written to a file.
- Example:
>>> BaseLoggingAdapter(LogLevel.DEBUG, true) BaseAdapter
>>> BaseAdapter() TypeError("LogLevel needs to be of type LogLevel.")
- Raises:
TypeError β If the arguments have the wrong type.
ValueError β If the LogLevel is not valid.
- get_instance(path: Path | None) BaseLogger[source]#
Produces a scoped instance of type BaseLogger.
- Parameters:
path (Path | None) β The scope of the instance
- Returns:
A scoped logger instance.
- Return type:
- Example:
>>> get_instance(Path('foo')) BaseLogger
>>> get_instance() ValueError("Path can not be empty of write was set to true.")
- Raises:
TypeError β If the arguments have the wrong type.
ValueError β If path is None while write is set to true.