refactor: replace .error() with .exception() logging for better debugging on sentry

This commit is contained in:
Krrish Dholakia 2024-08-16 09:22:47 -07:00
parent 62365835f3
commit 2874b94fb1
35 changed files with 242 additions and 253 deletions

View file

@ -1,13 +1,15 @@
# What this does?
## Checks if key is allowed to use the cache controls passed in to the completion() call
import traceback
from fastapi import HTTPException
import litellm
from litellm import verbose_logger
from litellm.caching import DualCache
from litellm.proxy._types import UserAPIKeyAuth
from litellm.integrations.custom_logger import CustomLogger
from fastapi import HTTPException
import traceback
from litellm.proxy._types import UserAPIKeyAuth
class _PROXY_CacheControlCheck(CustomLogger):
@ -54,9 +56,8 @@ class _PROXY_CacheControlCheck(CustomLogger):
except HTTPException as e:
raise e
except Exception as e:
verbose_logger.error(
verbose_logger.exception(
"litellm.proxy.hooks.cache_control_check.py::async_pre_call_hook(): Exception occured - {}".format(
str(e)
)
)
verbose_logger.debug(traceback.format_exc())