From f021410622cb9be19ba72ee63c55bf9177202418 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Mar 2026 21:45:45 +0000 Subject: [PATCH] Verbose logging: show DEBUG on console with func name and line number MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Lower console handler from INFO to DEBUG so all log calls are visible - Enrich format to include function name and line number for full context: TIMESTAMP [LEVEL ] module.func:line — message https://claude.ai/code/session_01KjaNo9RXevw6x1DjJD8mj6 --- modules/logger.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/logger.py b/modules/logger.py index dfc8b4d..c5352b5 100644 --- a/modules/logger.py +++ b/modules/logger.py @@ -5,7 +5,7 @@ from logging.handlers import RotatingFileHandler from pathlib import Path LOG_PATH = Path(__file__).parent.parent / "data" / "mailrelay.log" -LOG_FORMAT = "%(asctime)s [%(levelname)s] %(name)s: %(message)s" +LOG_FORMAT = "%(asctime)s [%(levelname)-8s] %(name)s.%(funcName)s:%(lineno)d — %(message)s" MAX_BYTES = 5 * 1024 * 1024 # 5 MB BACKUP_COUNT = 3 @@ -27,9 +27,9 @@ def get_logger(name: str) -> logging.Logger: file_handler.setLevel(logging.DEBUG) file_handler.setFormatter(logging.Formatter(LOG_FORMAT)) - # Console handler (INFO and above) + # Console handler (all levels) console_handler = logging.StreamHandler() - console_handler.setLevel(logging.INFO) + console_handler.setLevel(logging.DEBUG) console_handler.setFormatter(logging.Formatter(LOG_FORMAT)) logger.addHandler(file_handler)