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 format(self, record):
      fields = {"prefix": "", "suffix": ""}
      if getattr(record, "depth", 0) > 0:
          if record.msg.startswith("#"):
              prefix = (record.depth - 1) * "│" + "└"
          elif record.depth == 1:
              prefix = "┬"
          else:
              prefix = (record.depth - 2) * "│" + "├┬"
          if not self.is_utf8:
              prefix = prefix.translate(ASCII_MAP) + "-"
          fields["prefix"] = prefix + " "
      if (
          hasattr(record, "size")
          and record.size is not None
          and record.size >= 1
      ):
          # Show object size in human-readable form.
          power = int(math.log(record.size, 2)) // 10
          size = record.size >> power * 10
          fields["suffix"] = " [%d %sB]" % (
              size,
              "KMGTP"[power] + "i" if power else "",
          )
      vars(record).update(fields)
      return super().format(record)
  
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 2 for calling the TraceFormatter obj's underlying member method code with example usage: obj.format(record) and returns: super