INNER CODE UNIT · Python

setup_logging

itbench-hub/ITBench · scenarios/sre/tools/kubernetes-topology-monitor/main.py:14

def setup_logging(log_level: str = "INFO"):
    """Set up logging configuration."""
    logging.basicConfig(
        level=getattr(logging, log_level),
        format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
    )

def run_snapshot_thread(topology, interval, logger):
    """Periodically save topology snapshots."""
    while True:
        try:
            topology.save_snapshot()
            topology.cleanup_old_snapshots()
            time.sleep(interval)
        except Exception as e:
            logger.error(f"Error in snapshot thread: {e}", exc_info=True)
            time.sleep(60)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…