From 48619f2b7bd6a71a86c4af57d151a21d1538d1ed Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Thu, 11 Sep 2025 20:07:26 -0700 Subject: [PATCH] fix(litellm_logging.py): support emitting raw response on self.litellm_request_debug is true Addresses https://github.com/BerriAI/litellm/issues/13814 --- litellm/litellm_core_utils/litellm_logging.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py index 59dd09f2728..2f21d280899 100644 --- a/litellm/litellm_core_utils/litellm_logging.py +++ b/litellm/litellm_core_utils/litellm_logging.py @@ -996,8 +996,14 @@ class Logging(LiteLLMLoggingBaseClass): self.model_call_details["additional_args"] = additional_args self.model_call_details["log_event_type"] = "post_api_call" + if self.litellm_request_debug: + attr = "warning" + else: + attr = "debug" + if json_logs: - verbose_logger.debug( + callattr = getattr(verbose_logger, attr) + callattr( "RAW RESPONSE:\n{}\n\n".format( self.model_call_details.get( "original_response", self.model_call_details @@ -1005,7 +1011,8 @@ class Logging(LiteLLMLoggingBaseClass): ), ) else: - print_verbose( + callattr = getattr(verbose_logger, attr) + callattr( "RAW RESPONSE:\n{}\n\n".format( self.model_call_details.get( "original_response", self.model_call_details