mirror of
https://github.com/Paillat-dev/flagger.git
synced 2026-01-02 01:06:21 +00:00
✨ Add log_level configuration to enhance logging flexibility (#8)
This commit is contained in:
@@ -21,7 +21,7 @@ from http_server import HttpServer
|
||||
from renderer.base import FlagRenderer
|
||||
from renderer.manager import RendererManager
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
logging.basicConfig(level=getattr(logging, CONFIG.log_level.upper()))
|
||||
|
||||
intents = Intents.default()
|
||||
app = App(
|
||||
|
||||
@@ -22,6 +22,7 @@ class Config(BaseModel):
|
||||
uvicorn_host: str = "0.0.0.0" # noqa: S104
|
||||
auto_sync_commands: bool = True
|
||||
flagwaver_path: Path
|
||||
log_level: str = "INFO"
|
||||
|
||||
|
||||
CONFIG = Config(
|
||||
@@ -32,6 +33,7 @@ CONFIG = Config(
|
||||
uvicorn_host=os.getenv("UVICORN_HOST", "0.0.0.0"), # noqa: S104
|
||||
auto_sync_commands=os.getenv("AUTO_SYNC_COMMANDS", "true") == "true",
|
||||
flagwaver_path=Path(os.getenv("FLAGWAVER_PATH", Path(__file__).parent / "flagwaver" / "dist")),
|
||||
log_level=os.getenv("LOG_LEVEL", "INFO"),
|
||||
)
|
||||
|
||||
__all__ = ["CONFIG"]
|
||||
|
||||
Reference in New Issue
Block a user