class_docstr: Tracks object tree depth and calculates pickled object size.
  
  A single instance of this wraps the module's logger, as the logging API
  doesn't allow setting it directly with a custom Logger subclass.  The added
  'trace()' method receives a pickle instance as the first argument and
  creates extra values to be added in the LogRecord from it, then calls
  'info()'.
  
  Usage of logger with 'trace()' method:
  
  >>> from dill.logger import adapter as logger  #NOTE: not dill.logger.logger
  >>> ...
  >>> def save_atype(pickler, obj):
  >>>     logger.trace(pickler, "Message with %s and %r etc. placeholders", 'text', obj)
  >>>     ...
class_docstr_tok: ["Tracks","object","tree","depth","and","calculates","pickled","object","size",".","A","single","instance","of","this","wraps","the","module","'s","logger",",","as","the","logging","API","does","n't","allow","setting","it","directly","with","a","custom","Logger","subclass",".","The","added","'trace","(",")","'","method","receives","a","pickle","instance","as","the","first","argument","and","creates","extra","values","to","be","added","in","the","LogRecord","from","it",",","then","calls","'info","(",")","'",".","Usage","of","logger","with","'trace","(",")","'","method",":",">",">",">","from","dill.logger","import","adapter","as","logger","#","NOTE",":","not","dill.logger.logger",">",">",">","...",">",">",">","def","save_atype","(","pickler",",","obj",")",":",">",">",">","logger.trace","(","pickler",",","``","Message","with","%","s","and","%","r","etc",".","placeholders","''",",","'text","'",",","obj",")",">",">",">","..."]
code: def addHandler(self, handler):
      formatter = TraceFormatter(
          "%(prefix)s%(message)s%(suffix)s", handler=handler
      )
      handler.setFormatter(formatter)
      self.logger.addHandler(handler)
  
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 TraceAdapter obj's underlying member method code with example usage: obj.addHandler(handler) without return types