From c898ffe63637eb9f91cd93dd9acda37f32dfafab Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Mon, 25 Mar 2024 18:26:58 -0700 Subject: [PATCH] (feat) improve cache debugging litellm --- litellm/caching.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/litellm/caching.py b/litellm/caching.py index 2c2a3f8bc1..5ec625b1b4 100644 --- a/litellm/caching.py +++ b/litellm/caching.py @@ -170,8 +170,10 @@ class RedisCache(BaseCache): ) except Exception as e: # NON blocking - notify users Redis is throwing an exception - print_verbose( - f"LiteLLM Redis Caching: async set() - Got exception from REDIS : {str(e)}" + verbose_logger.error( + "LiteLLM Redis Caching: async set() - Got exception from REDIS %s, Writing value=%s", + str(e), + value, ) traceback.print_exc() @@ -200,7 +202,12 @@ class RedisCache(BaseCache): # Optionally, you could process 'results' to make sure that all set operations were successful. return results except Exception as e: - print_verbose(f"Error occurred in pipeline write - {str(e)}") + verbose_logger.error( + "LiteLLM Redis Caching: async set_cache_pipeline() - Got exception from REDIS %s, Writing value=%s", + str(e), + cache_value, + ) + traceback.print_exc() async def batch_cache_write(self, key, value, **kwargs): print_verbose(