From 7fdef46a2a498d703a850c2eb39cd29583fba6ef Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Wed, 20 May 2026 16:10:37 -0700 Subject: [PATCH] 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 --- litellm/_logging.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/litellm/_logging.py b/litellm/_logging.py index 6b99f50e014..c488b534af2 100644 --- a/litellm/_logging.py +++ b/litellm/_logging.py @@ -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