code: def log_event(
      self,
      kwargs,
      response_obj,
      start_time,
      end_time,
      user_id,
      print_verbose,
  ):
      # Method definition
  
      try:
          print_verbose(
              f"Langfuse Logging - Enters logging function for model {kwargs}"
          )
          litellm_params = kwargs.get("litellm_params", {})
          metadata = (
              litellm_params.get("metadata", {}) or {}
          )  # if litellm_params['metadata'] == None
          prompt = [kwargs.get("messages")]
          optional_params = kwargs.get("optional_params", {})
  
          optional_params.pop("functions", None)
          optional_params.pop("tools", None)
  
          # langfuse only accepts str, int, bool, float for logging
          for param, value in optional_params.items():
              if not isinstance(value, (str, int, bool, float)):
                  try:
                      optional_params[param] = str(value)
                  except:
                      # if casting value to str fails don't block logging
                      pass
  
          # end of processing langfuse ########################
          input = prompt
          output = response_obj["choices"][0]["message"].json()
          print_verbose(
              f"OUTPUT IN LANGFUSE: {output}; original: {response_obj['choices'][0]['message']}"
          )
          self._log_langfuse_v2(
              user_id,
              metadata,
              output,
              start_time,
              end_time,
              kwargs,
              optional_params,
              input,
              response_obj,
          ) if self._is_langfuse_v2() else self._log_langfuse_v1(
              user_id,
              metadata,
              output,
              start_time,
              end_time,
              kwargs,
              optional_params,
              input,
              response_obj,
          )
  
          self.Langfuse.flush()
          print_verbose(
              f"Langfuse Layer Logging - final response object: {response_obj}"
          )
      except:
          traceback.print_exc()
          print_verbose(
              f"Langfuse Layer Error - {traceback.format_exc()}"
          )
          pass
  
file_path: litellm/litellm/integrations/langfuse.py
imports: import dotenv, os
  import requests
  import requests
  from datetime import datetime
  import traceback
  from packaging.version import Version
label_desc: Use image node_id 2 for calling the LangFuseLogger obj's underlying member method code with example usage: obj.log_event(kwargs, response_obj, start_time, end_time, user_id, print_verbose) without return types