Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

chore: ruff fixes for logging

KCaverlyd0271f87bb5b
diff --git a/dspy/utils/logging.py b/dspy/utils/logging.py
index e1ccfa5f6..a80fdf57d 100644
--- a/dspy/utils/logging.py
+++ b/dspy/utils/logging.py
@@ -1,13 +1,13 @@
-import structlog
import logging
import os
-level = os.environ.get("LOG_LEVEL", "INFO").upper()
+import structlog
-def set_log_level(level: str):
- """Set the logging level"""
+level = os.environ.get("LOG_LEVEL", "INFO").upper()
+def set_log_level(level: str) -> None:
+ """Set the logging level."""
level = level.upper()
if level not in ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]:
raise ValueError("log level provider ({level}) is not one of DEBUG, INFO, WARNING, ERROR, CRITICAL")