diff options
Diffstat (limited to 'app/converter')
| -rw-r--r-- | app/converter/audio.py | 7 | ||||
| -rw-r--r-- | app/converter/config.py | 2 | ||||
| -rw-r--r-- | app/converter/converter.py | 11 |
3 files changed, 11 insertions, 9 deletions
diff --git a/app/converter/audio.py b/app/converter/audio.py index def4395..58cd5a5 100644 --- a/app/converter/audio.py +++ b/app/converter/audio.py @@ -9,11 +9,12 @@ import logging import re import shutil import subprocess -import traceback import wave from pathlib import Path from typing import Dict, List, NamedTuple, Optional, Tuple +import logging_kit + from . import config logger = logging.getLogger(__name__) @@ -459,7 +460,7 @@ def combine_chunks(total_chunks: int, output_path: Path, return False except Exception as exc: logger.error("Failed to combine chunks: %s", exc) - logger.error(traceback.format_exc()) + logging_kit.log_traceback() return False finally: try: @@ -618,7 +619,7 @@ def combine_chapters_to_m4b(chapter_files: List[Path], titles: List[str], return False except Exception as exc: logger.error("Failed to combine chapters: %s", exc) - logger.error(traceback.format_exc()) + logging_kit.log_traceback() return False finally: for scratch in (concat_list, metadata_file, speed_metadata_file): diff --git a/app/converter/config.py b/app/converter/config.py index d0028dc..e37269b 100644 --- a/app/converter/config.py +++ b/app/converter/config.py @@ -90,7 +90,7 @@ FASTER_VOICE = "narrator" ############################################################################### # BACKEND 3: audio.cpp options # ############################################################################### -AUDIOCPP_API_URL = "http://127.0.0.1:8080" # audio.cpp audiocpp_server +AUDIOCPP_API_URL = "http://127.0.0.1:8082" # audio.cpp audiocpp_server AUDIOCPP_REMOTE_URL = "http://127.0.0.1:8080" # externally-run audiocpp_server ("" disables probing) # Model ids in the audio.cpp server.json config. AUDIOCPP_MODEL_ID may point 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: |
