code: def __init__(self, formatter_type, **kwargs):
      super().__init__(**kwargs)
      if formatter_type == "file":
          self._formatters = defaultdict(
              lambda: logging.Formatter(
                  self.FILE_FMT, self.FILE_DATE_FMT
              )
          )
      else:
          self._formatters = defaultdict(
              lambda: logging.Formatter(
                  self.STREAM_FMT, self.STREAM_DATE_FMT
              ),
              {
                  logging.WARNING: logging.Formatter(
                      Fore.YELLOW + self.STREAM_FMT + Fore.RESET,
                      self.STREAM_DATE_FMT,
                  ),
                  logging.ERROR: logging.Formatter(
                      Fore.RED + self.STREAM_FMT + Fore.RESET,
                      self.STREAM_DATE_FMT,
                  ),
                  logging.CRITICAL: logging.Formatter(
                      Fore.RED
                      + Style.BRIGHT
                      + self.STREAM_FMT
                      + Fore.RESET,
                      self.STREAM_DATE_FMT,
                  ),
              },
          )
  
file_path: TextBox/textbox/utils/logger.py
imports: import logging
  import os
  from accelerate.logging import get_logger
  from textbox.utils.utils import ensure_dir
  from collections import defaultdict
  from colorama import init, Fore, Style
  from typing import Optional
label_desc: Use image node_id 1 to create a new ColorFormatter object from inherited base classes: logging with example: obj = ColorFormatter(formatter_type)