feature: add logging when passthrough return Result

This commit is contained in:
KnyazSh 2026-04-16 15:33:40 +00:00
parent bf36953dcb
commit 52796fb060

View file

@ -1852,6 +1852,11 @@ class Logging(LiteLLMLoggingBaseClass):
logging_result = self.normalize_logging_result(result=result)
if isinstance(result, Response) and isinstance(
logging_result, ModelResponse
):
result = logging_result
if (
standard_logging_object is None
and result is not None
@ -5569,7 +5574,13 @@ def get_standard_logging_object_payload(
def emit_standard_logging_payload(payload: StandardLoggingPayload):
if os.getenv("LITELLM_PRINT_STANDARD_LOGGING_PAYLOAD"):
print(json.dumps(payload, indent=4)) # noqa
try:
print(json.dumps(payload, indent=4, default=str)) # noqa
except Exception as e:
print(
"Error serializing standard logging payload for debug output:",
str(e),
)
def get_standard_logging_metadata(