Skip to main content
Glama
logger.py953 B
# src/server/utils/logger.py """Structured logging configuration using structlog. All modules should import logger via: from src.server.utils.logger import logger """ import logging import sys import structlog def configure_logging(level: str = "INFO"): logging.basicConfig( level=getattr(logging, level.upper(), logging.INFO), format="%(asctime)s %(levelname)s %(name)s %(message)s", stream=sys.stderr, ) structlog.configure( processors=[ structlog.processors.TimeStamper(fmt="%Y-%m-%d %H:%M:%S"), # 禁用 ASCII 转义以支持 emoji 表情符号的正常显示 structlog.processors.JSONRenderer(ensure_ascii=False), ], logger_factory=structlog.stdlib.LoggerFactory(), wrapper_class=structlog.stdlib.BoundLogger, cache_logger_on_first_use=True, ) # Initialize at import time configure_logging() logger = structlog.get_logger()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/huweihua123/stock-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server