docs: add comprehensive docstrings to logging utility functions

- Add docstring to _redact_string explaining behavior with redaction setting
- Add docstring to _turn_on_debug explaining debug-level logging enablement
- Add docstring to _disable_debugging explaining logger suppression
- Add docstring to _enable_debugging explaining logger re-enablement
- Add docstring to print_verbose noting legacy status and secret redaction
This commit is contained in:
Ishaan Jaffer 2026-05-20 16:10:37 -07:00
parent 79b4578671
commit 7fdef46a2a
No known key found for this signature in database

View file

@ -411,12 +411,25 @@ def _disable_debugging():
def _enable_debugging():
"""Enable all LiteLLM verbose loggers.
Re-enables output from the package, router, and proxy loggers after they
have been disabled.
"""
verbose_logger.disabled = False
verbose_router_logger.disabled = False
verbose_proxy_logger.disabled = False
def print_verbose(print_statement):
"""Print a statement if verbose mode is enabled, with secrets redacted.
This is a legacy function that checks the deprecated set_verbose flag.
For new code, use the logging system directly instead.
Args:
print_statement: The message to print. Will be converted to string.
"""
try:
if set_verbose:
print(redact_secrets(str(print_statement))) # noqa