"""Logging utilities."""
import logging
from typing import Any
def get_logger(name: str) -> logging.Logger:
"""Get a logger instance.
Args:
name: Logger name
Returns:
Logger instance
"""
return logging.getLogger(name)
def log_tool_execution(tool_name: str, arguments: dict[str, Any], result: Any) -> None:
"""Log tool execution details.
Args:
tool_name: Name of the executed tool
arguments: Tool arguments
result: Tool execution result
"""
logger = get_logger("mcp_server_hero.tools")
logger.debug(f"Tool '{tool_name}' executed with args: {arguments}")
logger.debug(f"Tool '{tool_name}' result: {result}")
def log_resource_access(resource_uri: str) -> None:
"""Log resource access.
Args:
resource_uri: URI of the accessed resource
"""
logger = get_logger("mcp_server_hero.resources")
logger.debug(f"Resource accessed: {resource_uri}")
def log_prompt_generation(prompt_name: str, arguments: dict[str, str] | None = None) -> None:
"""Log prompt generation.
Args:
prompt_name: Name of the generated prompt
arguments: Prompt arguments
"""
logger = get_logger("mcp_server_hero.prompts")
logger.debug(f"Prompt '{prompt_name}' generated with args: {arguments}")