Logger Helper Functions#
- expectmine.logger.utils.validate_adapter_init(log_level: LogLevel, write_logfile: bool)[source]#
Validates the adapter init parameters.
- 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:
>>> validate_init(LogLevel.DEBUG, true) BaseAdapter
>>> validate_init() TypeError("LogLevel needs to be of type LogLevel.")
- Raises:
TypeError β If the arguments have the wrong type.
ValueError β If the LogLevel is not valid.
- expectmine.logger.utils.validate_init(log_level: LogLevel, write: bool, path: Path | None)[source]#
Validates the init parameters.
- Parameters:
log_level (LogLevel) β The minimal logging priority that should be logged.
write (bool) β Boolean indicating weather logs should be written to a file.
path (Path | None) β If write is set to true, logger will log to this path.
- Example:
>>> validate_init(LogLevel.DEBUG, true) BaseAdapter
>>> validate_init() TypeError("LogLevel needs to be of type LogLevel.")
- Raises:
TypeError β If the arguments have the wrong type.
ValueError β If the LogLevel is not valid. Or path is None while write is set to true.