diff options
| author | historia <historiavg@proton.me> | 2026-08-28 13:51:01 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-28 13:51:01 -0400 |
| commit | afb2c2d5b297c5aa28bcced0e3f90e207d799c2a (patch) | |
| tree | 80e6c336736a7c441160db8f52c9e3403497610a /app/converter/converter.py | |
| parent | 5ed31309b6d0db94ccd566914653d367f4577c64 (diff) | |
| download | tts-audiobook-generator-afb2c2d5b297c5aa28bcced0e3f90e207d799c2a.tar.gz | |
fix: remove backtrace from console output when using incorrect/incomplete cli flags
Diffstat (limited to 'app/converter/converter.py')
| -rw-r--r-- | app/converter/converter.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/converter/converter.py b/app/converter/converter.py index 405073a..5235991 100644 --- a/app/converter/converter.py +++ b/app/converter/converter.py @@ -7,7 +7,6 @@ import shutil import sys import threading import time -import traceback from collections import Counter from datetime import datetime from pathlib import Path @@ -70,8 +69,10 @@ SUPPORTED_FORMATS = [".txt", ".pdf", ".epub"] def _console_log_filter(record: logging.LogRecord) -> bool: - """Keep httpx/httpcore request logs out of the console (file only).""" - return not record.name.startswith(("httpx", "httpcore")) + """Keep httpx/httpcore request logs and file-only traceback dumps out + of the console (file only).""" + return not record.name.startswith( + ("httpx", "httpcore", logging_kit.TRACEBACK_LOGGER)) def setup_logging(debug: bool = False, console: bool = True) -> None: @@ -511,7 +512,7 @@ class AudiobookConverter: raise except Exception as exc: logger.error("Conversion failed: %s", exc) - logger.error(traceback.format_exc()) + logging_kit.log_traceback() return False finally: # Always cleanup, even on failure or interrupt @@ -722,7 +723,7 @@ class AudiobookConverter: raise except Exception as exc: logger.error("Conversion failed: %s", exc) - logger.error(traceback.format_exc()) + logging_kit.log_traceback() return False def _print_banner(self) -> None: |
