diff --git a/litellm/_service_logger.py b/litellm/_service_logger.py index 89c177b91a5..958b31a8c8c 100644 --- a/litellm/_service_logger.py +++ b/litellm/_service_logger.py @@ -141,7 +141,9 @@ class ServiceLogging(CustomLogger): database queries with ``SynchronousOnlyOperation``. So skip it when there is no service callback (or test counter) to receive the event. """ - return bool(litellm.service_callback) or self.mock_testing + if litellm.service_callback: + return True + return self.mock_testing @staticmethod def _dispatch_from_sync(hook: Callable[[], Coroutine[object, object, None]]) -> None: