mirror of
https://github.com/smittix/intercept.git
synced 2026-04-25 07:10:00 -07:00
- Fix SSE fanout thread AttributeError when source queue is None during interpreter shutdown by snapshotting to local variable with null guard - Fix branded "i" logo rendering oversized on first page load (FOUC) by adding inline width/height to SVG elements across 10 templates - Bump version to 2.26.0 in config.py, pyproject.toml, and CHANGELOG.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
31 lines
960 B
Python
31 lines
960 B
Python
"""Logging utilities for intercept application."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import logging
|
|
import sys
|
|
|
|
from config import LOG_FORMAT, LOG_LEVEL
|
|
|
|
|
|
def get_logger(name: str) -> logging.Logger:
|
|
"""Get a configured logger for a module."""
|
|
logger = logging.getLogger(name)
|
|
if not logger.handlers:
|
|
handler = logging.StreamHandler(sys.stderr)
|
|
handler.setFormatter(logging.Formatter(LOG_FORMAT))
|
|
logger.addHandler(handler)
|
|
logger.setLevel(LOG_LEVEL)
|
|
logger.propagate = False # Prevent duplicate logs from parent handlers
|
|
return logger
|
|
|
|
|
|
# Pre-configured loggers for each module
|
|
app_logger = get_logger('intercept')
|
|
pager_logger = get_logger('intercept.pager')
|
|
sensor_logger = get_logger('intercept.sensor')
|
|
wifi_logger = get_logger('intercept.wifi')
|
|
bluetooth_logger = get_logger('intercept.bluetooth')
|
|
adsb_logger = get_logger('intercept.adsb')
|
|
satellite_logger = get_logger('intercept.satellite')
|