mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-04-24 13:54:59 +00:00
- 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.
30 lines
881 B
Python
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()
|
|
]
|
|
)
|