Build and run agents you can see, understand and trust.
Python agentchatbotlarge-language-modelsllmllm-agentmcpmulti-agentmulti-modalreact-agentrealtime-agentvoice-agentvoice-assistant
Improve logging setup by validating the input level (#715)
MirzaSamadAhmedBaig30cd271140b4
diff --git a/src/agentscope/_logging.py b/src/agentscope/_logging.pyindex dd5f8c115..caf29a053 100644--- a/src/agentscope/_logging.py+++ b/src/agentscope/_logging.py@@ -25,6 +25,11 @@ def setup_logger(filepath (`str | None`, optional):The filepath to save the logging output."""+ if level not in ["INFO", "DEBUG", "WARNING", "ERROR", "CRITICAL"]:+ raise ValueError(+ f"Invalid logging level: {level}. Must be one of "+ f"'INFO', 'DEBUG', 'WARNING', 'ERROR', 'CRITICAL'.",+ )logger.handlers.clear()logger.setLevel(level)handler = logging.StreamHandler()