feat: add centralized logging to replace ad-hoc print statements (#1254)

* feat: add logging utility functions

* feat: add logging setup and log level argument to CLI

* feat: integrate logging across modules
This commit is contained in:
Barabazs
2025-10-10 08:41:06 +02:00
committed by GitHub
parent 3b1b9a8c4d
commit a51ae7a81a
9 changed files with 145 additions and 20 deletions
+26
View File
@@ -29,3 +29,29 @@ def load_audio(*args, **kwargs):
def assign_word_speakers(*args, **kwargs):
diarize = _lazy_import("diarize")
return diarize.assign_word_speakers(*args, **kwargs)
def setup_logging(*args, **kwargs):
"""
Configure logging for WhisperX.
Args:
level: Logging level (debug, info, warning, error, critical). Default: warning
log_file: Optional path to log file. If None, logs only to console.
"""
logging_module = _lazy_import("log_utils")
return logging_module.setup_logging(*args, **kwargs)
def get_logger(*args, **kwargs):
"""
Get a logger instance for the given module.
Args:
name: Logger name (typically __name__ from calling module)
Returns:
Logger instance configured with WhisperX settings
"""
logging_module = _lazy_import("log_utils")
return logging_module.get_logger(*args, **kwargs)