raise if log_level is wrong type

This commit is contained in:
Lendemor 2025-01-21 23:41:00 +01:00
parent 85b6b446e5
commit c78a501299

View File

@ -49,7 +49,12 @@ def set_log_level(log_level: LogLevel):
Args:
log_level: The log level to set.
Raises:
TypeError: If the log level is a string.
"""
if isinstance(log_level, str):
raise TypeError("log_level must be a LogLevel enum value, not str.")
global _LOG_LEVEL
_LOG_LEVEL = log_level