Coverage for app/core/logger.py: 75%
12 statements
« prev ^ index » next coverage.py v7.6.10, created at 2026-06-04 22:29 +0000
« prev ^ index » next coverage.py v7.6.10, created at 2026-06-04 22:29 +0000
1import json
2import logging.config
3from pathlib import Path
5logger = logging.getLogger("pypacktrends")
7try:
8 config_path = Path(__file__).parent / "logger_config.json"
9 with open(config_path, "r") as f:
10 config = json.load(f)
11 logging.config.dictConfig(config)
12except Exception as e:
13 logging.basicConfig(level=logging.INFO)
14 logger.error(f"Failed to load logging config: {e}")