code: def setup_logging(output_dir=None):
      """
      Sets up the logging for multiple processes. Only enable the logging for the
      master process, and suppress logging for the non-master processes.
      """
      # Set up logging format.
      _FORMAT = (
          "[%(levelname)s: %(filename)s: %(lineno)4d]: %(message)s"
      )
  
      if du.is_master_proc():
          # Enable logging for the master process.
          logging.root.handlers = []
      else:
          # Suppress logging for non-master processes.
          _suppress_print()
  
      logger = logging.getLogger()
      logger.setLevel(logging.DEBUG)
      logger.propagate = False
      plain_formatter = logging.Formatter(
          "[%(asctime)s][%(levelname)s] %(filename)s: %(lineno)4d: %(message)s",
          datefmt="%m/%d %H:%M:%S",
      )
  
      if du.is_master_proc():
          ch = logging.StreamHandler(stream=sys.stdout)
          ch.setLevel(logging.DEBUG)
          ch.setFormatter(plain_formatter)
          logger.addHandler(ch)
  
      if output_dir is not None and du.is_master_proc(
          du.get_world_size()
      ):
          filename = os.path.join(output_dir, "stdout.log")
          fh = logging.StreamHandler(_cached_log_stream(filename))
          fh.setLevel(logging.DEBUG)
          fh.setFormatter(plain_formatter)
          logger.addHandler(fh)
  
file_path: SlowFast/slowfast/utils/logging.py
imports: import atexit
  import builtins
  import decimal
  import functools
  import logging
  import os
  import sys
  import simplejson
  import slowfast.utils.distributed
  from slowfast.utils.env import pathmgr
label_desc: Use image node_id 3 for calling a global function with example usage: setup_logging(output_dir) without return types