code: def _configure_logging() -> logging.Logger:
      """Configure logging for the Spark Connect clients."""
      logger = logging.getLogger(__name__)
      handler = logging.StreamHandler()
      handler.setFormatter(
          logging.Formatter(
              fmt="%(asctime)s %(process)d %(levelname)s %(funcName)s %(message)s"
          )
      )
      logger.addHandler(handler)
  
      # Check the environment variables for log levels:
      if "SPARK_CONNECT_LOG_LEVEL" in os.environ:
          logger.setLevel(os.environ["SPARK_CONNECT_LOG_LEVEL"].upper())
      else:
          logger.disabled = True
      return logger
  
imports: import logging
  import os
  from typing import Optional
label_desc: Use image node_id 1 for calling a global function with example usage: _configure_logging() and returns: logger