class_docstr: Generates message prefix and suffix from record.
  
  This Formatter adds prefix and suffix strings to the log message in trace
  mode (an also provides empty string defaults for normal logs).
class_docstr_tok: ["Generates","message","prefix","and","suffix","from","record",".","This","Formatter","adds","prefix","and","suffix","strings","to","the","log","message","in","trace","mode","(","an","also","provides","empty","string","defaults","for","normal","logs",")","."]
code: def __init__(self, *args, handler=None, **kwargs):
      super().__init__(*args, **kwargs)
      try:
          encoding = handler.stream.encoding
          if encoding is None:
              raise AttributeError
      except AttributeError:
          encoding = locale.getpreferredencoding()
      try:
          encoding = codecs.lookup(encoding).name
      except LookupError:
          self.is_utf8 = False
      else:
          self.is_utf8 = encoding == codecs.lookup("utf-8").name
  
imports: import codecs
  import contextlib
  import locale
  import logging
  import math
  import os
  from functools import partial
  from typing import TextIO, Union
  import dill
label_desc: Use image node_id 1 to create a new TraceFormatter object from inherited base classes: logging with example: obj = TraceFormatter()