From 0341b6fa2bdfb22705356dd70d952ba2dfa7da36 Mon Sep 17 00:00:00 2001 From: Harshit Jain <48647625+Harshit28j@users.noreply.github.com> Date: Mon, 16 Feb 2026 19:34:13 +0530 Subject: [PATCH] Update litellm/litellm_core_utils/litellm_logging.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- litellm/litellm_core_utils/litellm_logging.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py index b2aee6bd2a..f5b12b9e0f 100644 --- a/litellm/litellm_core_utils/litellm_logging.py +++ b/litellm/litellm_core_utils/litellm_logging.py @@ -3176,12 +3176,15 @@ class Logging(LiteLLMLoggingBaseClass): # Keep all non-Langfuse callbacks filtered.append(cb) - verbose_logger.debug( - f"[LANGFUSE DEBUG] Filtered callbacks AFTER filtering: {[self._get_callback_name(cb) for cb in filtered]}" - ) + if verbose_logger.isEnabledFor(logging.DEBUG): + verbose_logger.debug( + "[LANGFUSE DEBUG] Filtered callbacks AFTER filtering: %s", + [self._get_callback_name(cb) for cb in filtered], + ) if langfuse_logger_found: verbose_logger.debug( - f"[LANGFUSE DEBUG] Langfuse logger kept: {self._get_callback_name(langfuse_logger_found)}" + "[LANGFUSE DEBUG] Langfuse logger kept: %s", + self._get_callback_name(langfuse_logger_found), ) # After Langfuse filtering, deduplicate remaining callbacks