Skip to main content
Glama
logger.py1.36 kB
"""Structured logging configuration.""" import logging import sys from typing import Any import structlog def get_logger(name: str) -> Any: """ Get a structured logger instance. Args: name: Logger name (typically __name__) Returns: Structured logger instance """ return structlog.get_logger(name) def configure_logging(log_level: str = "INFO") -> None: """ Configure structured logging for the application. Args: log_level: Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL) """ logging.basicConfig( format="%(message)s", stream=sys.stdout, level=getattr(logging, log_level.upper()), ) structlog.configure( processors=[ structlog.contextvars.merge_contextvars, structlog.processors.add_log_level, structlog.processors.StackInfoRenderer(), structlog.dev.set_exc_info, structlog.processors.TimeStamper(fmt="iso"), structlog.dev.ConsoleRenderer() if sys.stdout.isatty() else structlog.processors.JSONRenderer(), ], wrapper_class=structlog.make_filtering_bound_logger( getattr(logging, log_level.upper()) ), context_class=dict, logger_factory=structlog.PrintLoggerFactory(), cache_logger_on_first_use=True, )

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/CTD-Techs/CTD-MCP'

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