code: def init_logger(config, proc_name=None):
      logger = logging.getLogger("fiber")
      if config.log_file.lower() == "stdout":
          handler = logging.StreamHandler()
      else:
          log_dir = os.path.dirname(config.log_file)
          if not os.path.exists(log_dir):
              os.makedirs(log_dir, exist_ok=True)
  
          if not proc_name:
              p = fiber.process.current_process()
              proc_name = p.name
  
          log_file = config.log_file + "." + proc_name
          handler = logging.FileHandler(log_file, mode="w")
  
      formatter = logging.Formatter(
          "%(asctime)s %(levelname)s:%(processName)s(%(process)d):"
          "%(threadName)s(%(thread)d){%(filename)s:%(lineno)d} %(message)s"
      )
      handler.setFormatter(formatter)
      if logger.handlers is None or len(logger.handlers) == 0:
          logger.addHandler(handler)
      else:
          logger.handlers[-1] = handler
      logger.propagate = False
  
file_path: fiber/fiber/init.py
imports: import logging
  import os
  import multiprocessing
  import fiber.process
  import fiber.config
  import fiber.backend
label_desc: Use image node_id 1 for calling a global function with example usage: init_logger(config, proc_name) without return types