src.utils.assert_valid_log_level

src.utils.assert_valid_log_level(log_level: str | None) str | None

Check the log level is a valid log level.

Log level is not case sensitive and is converted to uppercase before checking. See https://docs.python.org/3/library/logging.html#logging-levels.

Parameters:

log_level – The log level to check.

Raises:

AssertionError – If the log level is not a valid log level.

Returns:

The log level if it is a valid log level.