code: def get_logger(config):
      """Create and configure a TFX-specific logger.
  
      Args:
        config: LoggingConfig class used to configure logger
      Returns:
        A logger that outputs to log_dir/log_file_name.
      Raises:
        RuntimeError: if log dir exists as a file.
  
      """
      log_path = os.path.join(config.log_root, "tfx.log")
      logger = logging.getLogger(log_path)
      logger.setLevel(config.log_level)
  
      if not fileio.exists(config.log_root):
          fileio.makedirs(config.log_root)
      if not fileio.isdir(config.log_root):
          raise RuntimeError(
              "Log dir exists as a file: {}".format(config.log_root)
          )
  
      # Create logfile handler.
      fh = logging.FileHandler(log_path)
      # Define logmsg format.
      formatter = logging.Formatter(
          "%(asctime)s - {}:{} (%(filename)s:%(lineno)s) - %(levelname)s: %(message)s".format(
              config.pipeline_name, config.worker_name
          )
      )
      fh.setFormatter(formatter)
      # Add handler to logger.
      logger.addHandler(fh)
  
      return logger
  
file_path: tfx/tfx/utils/logging_utils.py
imports: import copy
  import logging
  import os
  from typing import Any, Dict, Optional
  from tfx.dsl.io import fileio
label_desc: Use image node_id 1 for calling a global function with example usage: get_logger(config) and returns: logger