code: def raise_log(
      exception: Exception,
      logger: logging.Logger = get_logger("main_logger"),
  ):
      """
      Can be used to replace "raise" when throwing an exception to ensure the logging
      of the exception. After logging it, the exception is raised.
  
      Parameters
      ----------
      exception
          The exception instance to be raised.
      logger
          The logger instance to log the exception type and message.
  
      Raises
      ------
      Exception
          The provided exception
      """
  
      exception_type = str(type(exception)).split("'")[1]
      message = str(exception)
      logger.error(exception_type + ": " + message)
  
      raise exception
  
file_path: darts/darts/logging.py
imports: import logging
  import os
  import time
  import warnings
label_desc: Use image node_id 5 for calling a global function with example usage: raise_log(exception, logger) without return types