This commit is contained in:
2026-09-09 10:29:02 +08:00
parent 2aa49b5263
commit ccb12dad7c
102 changed files with 7879 additions and 559 deletions

View File

@@ -0,0 +1,29 @@
"""日志:直接用 stdlib logging(真实模板用 jiangchang_skill_core.unified_logging)。
为保持与模板 ``from util.logging_config import get_skill_logger, setup_skill_logging``
一致的调用面,本 demo 提供同名薄封装。
"""
from __future__ import annotations
import logging
from util.constants import LOG_LOGGER_NAME
_configured = False
def setup_skill_logging(skill_slug: str, logger_name: str) -> None:
global _configured
if _configured:
return
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)s %(name)s: %(message)s"))
logger = logging.getLogger(logger_name)
logger.setLevel(logging.INFO)
if not logger.handlers:
logger.addHandler(handler)
_configured = True
def get_skill_logger() -> logging.Logger:
return logging.getLogger(LOG_LOGGER_NAME)