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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user