structured-logging
Installation
SKILL.md
Structured Logging
Production logging patterns for Python services. Replace stdlib logging with structured, machine-parseable output that integrates with Grafana Loki.
Setup: loguru + structlog
# src/coremind/core/logging.py
import structlog
from loguru import logger
import sys
import json
def setup_logging(json_output: bool = True, level: str = "INFO"):
"""Configure structured logging for CoreMind services."""
# Remove default loguru handler
logger.remove()