Files
AutoMetabuilder/backend/autometabuilder/logging_config.py
johndoe6345789 877ba64de8 Introduce AutoMetabuilder core components and workflow packages:
- Implement core components: CLI argument parsing, environment loading, GitHub service creation, and logging configuration.
- Add support for OpenAI client setup and model resolution.
- Develop SDLC context loader from GitHub and repository files.
- Implement workflow context and engine builders.
- Introduce major workflow packages: `game_tick_loop` and `contextual_iterative_loop`.
- Update localization files with new package descriptions and labels.
- Streamline web navigation by loading items from a dedicated JSON file.
2026-01-10 00:45:46 +00:00

30 lines
881 B
Python

"""Logging configuration with TRACE support."""
import logging
import os
TRACE_LEVEL = 5
def configure_logging() -> None:
"""Configure logging with TRACE support."""
logging.addLevelName(TRACE_LEVEL, "TRACE")
if not hasattr(logging, "TRACE"):
setattr(logging, "TRACE", TRACE_LEVEL)
def trace(self, message, *args, **kwargs):
if self.isEnabledFor(TRACE_LEVEL):
self.log(TRACE_LEVEL, message, *args, **kwargs)
logging.Logger.trace = trace # type: ignore[attr-defined]
level_name = os.environ.get("LOG_LEVEL", "INFO").upper()
level = getattr(logging, level_name, logging.INFO)
logging.basicConfig(
level=level,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
handlers=[
logging.FileHandler("autometabuilder.log"),
logging.StreamHandler()
]
)