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.