From 933c693e9b07fa1853fd35f70428627dad5bfd26 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 25 Jan 2024 18:47:50 -0800 Subject: [PATCH] s3 logger - add better debug statements --- litellm/integrations/s3.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/litellm/integrations/s3.py b/litellm/integrations/s3.py index e03c0ccacfc..9d756c7f7ec 100644 --- a/litellm/integrations/s3.py +++ b/litellm/integrations/s3.py @@ -8,7 +8,7 @@ dotenv.load_dotenv() # Loading env variables using dotenv import traceback import datetime, subprocess, sys import litellm, uuid -from litellm._logging import print_verbose +from litellm._logging import print_verbose, verbose_logger class S3Logger: @@ -31,7 +31,7 @@ class S3Logger: import boto3 try: - print_verbose( + verbose_logger.debug( f"in init s3 logger - s3_callback_params {litellm.s3_callback_params}" ) @@ -61,6 +61,7 @@ class S3Logger: self.bucket_name = s3_bucket_name self.s3_path = s3_path + verbose_logger.debug(f"s3 logger using endpoint url {s3_endpoint_url}") # Create an S3 client with custom endpoint URL self.s3_client = boto3.client( "s3", @@ -86,7 +87,9 @@ class S3Logger: def log_event(self, kwargs, response_obj, start_time, end_time, print_verbose): try: - print_verbose(f"s3 Logging - Enters logging function for model {kwargs}") + verbose_logger.debug( + f"s3 Logging - Enters logging function for model {kwargs}" + ) # construct payload to send to s3 # follows the same params as langfuse.py @@ -154,5 +157,5 @@ class S3Logger: return response except Exception as e: traceback.print_exc() - print_verbose(f"s3 Layer Error - {str(e)}\n{traceback.format_exc()}") + verbose_logger.debug(f"s3 Layer Error - {str(e)}\n{traceback.format_exc()}") pass