class_docstr: Log formatter used in Tornado. Key features of this formatter are:
  * Color support when logging to a terminal that supports it.
  * Timestamps on every log line.
  * Robust against str/bytes encoding problems.
class_docstr_tok: ["Log","formatter","used","in","Tornado",".","Key","features","of","this","formatter","are",":","*","Color","support","when","logging","to","a","terminal","that","supports","it",".","*","Timestamps","on","every","log","line",".","*","Robust","against","str\/bytes","encoding","problems","."]
docstr: :arg bool color: Enables color support.
  :arg string fmt: Log message format.
    It will be applied to the attributes dict of log records. The
    text between ``%(color)s`` and ``%(end_color)s`` will be colored
    depending on the level if color support is on.
  :arg dict colors: color mappings from logging level to terminal color
    code
  :arg string datefmt: Datetime format.
    Used for formatting ``(asctime)`` placeholder in ``prefix_fmt``.
  .. versionchanged:: 3.2
     Added ``fmt`` and ``datefmt`` arguments.
docstr_tok: [":","arg","bool","color",":","Enables","color","support",".",":","arg","string","fmt",":","Log","message","format",".","It","will","be","applied","to","the","attributes","dict","of","log","records",".","The","text","between","``","%","(","color",")","s","``","and","``","%","(","end_color",")","s","``","will","be","colored","depending","on","the","level","if","color","support","is","on",".",":","arg","dict","colors",":","color","mappings","from","logging","level","to","terminal","color","code",":","arg","string","datefmt",":","Datetime","format",".","Used","for","formatting","``","(","asctime",")","``","placeholder","in","``","prefix_fmt","``",".","..","versionchanged",":",":","3.2","Added","``","fmt","``","and","``","datefmt","``","arguments","."]
code: def __init__(self, color=True, fmt=None, datefmt=None, colors=None):
      r"""
      :arg bool color: Enables color support.
      :arg string fmt: Log message format.
        It will be applied to the attributes dict of log records. The
        text between ``%(color)s`` and ``%(end_color)s`` will be colored
        depending on the level if color support is on.
      :arg dict colors: color mappings from logging level to terminal color
        code
      :arg string datefmt: Datetime format.
        Used for formatting ``(asctime)`` placeholder in ``prefix_fmt``.
      .. versionchanged:: 3.2
         Added ``fmt`` and ``datefmt`` arguments.
      """
  
      if fmt is None:
          fmt = self.DEFAULT_FORMAT
  
      if datefmt is None:
          datefmt = self.DEFAULT_DATE_FORMAT
  
      if colors is None:
          colors = self.DEFAULT_COLORS
  
      logging.Formatter.__init__(self, datefmt=datefmt)
  
      self._fmt = fmt
      self._colors = {}
      self._normal = ""
  
      if color and check_color_support():
          self._colors = colors
          self._normal = ForegroundColors.RESET
  
file_path: NeMo/nemo/utils/formatters/base.py
imports: import logging
  from nemo.utils.formatters.colors import Fore
  from nemo.utils.formatters.utils import check_color_support, to_unicode
label_desc: Use image node_id 1 to create a new BaseFormatter object from inherited base classes: logging with example: obj = BaseFormatter(color, fmt, datefmt, colors)