class_docstr: Log formatter with level-specific formatting.
  
  Formatter class which optionally takes a dict of logging levels to
  format strings, allowing to customise the log records appearance for
  specific levels.
  
  
  Attributes:
          fmt: A dictionary mapping logging levels to format strings.
                  The ``*`` key identifies the default format string.
          datefmt: As per py:class:`logging.Formatter`
          style: As per py:class:`logging.Formatter`
  
  >>> import sys
  >>> handler = logging.StreamHandler(sys.stdout)
  >>> formatter = LevelFormatter(
  ...     fmt={
  ...         '*':     '[%(levelname)s] %(message)s',
  ...         'DEBUG': '%(name)s [%(levelname)s] %(message)s',
  ...         'INFO':  '%(message)s',
  ...     })
  >>> handler.setFormatter(formatter)
  >>> log = logging.getLogger('test')
  >>> log.setLevel(logging.DEBUG)
  >>> log.addHandler(handler)
  >>> log.debug('this uses a custom format string')
  test [DEBUG] this uses a custom format string
  >>> log.info('this also uses a custom format string')
  this also uses a custom format string
  >>> log.warning("this one uses the default format string")
  [WARNING] this one uses the default format string
code: def format(self, record):
      if self.custom_formats:
          fmt = self.custom_formats.get(
              record.levelno, self.default_format
          )
          if self._fmt != fmt:
              self._fmt = fmt
              # for python >= 3.2, _style needs to be set if _fmt changes
              if PercentStyle:
                  self._style = PercentStyle(fmt)
      return super(LevelFormatter, self).format(record)
  
imports: import sys
  import logging
  import timeit
  from functools import wraps
  from collections.abc import Mapping, Callable
  import warnings
  from logging import PercentStyle
label_desc: Use image node_id 2 for calling the LevelFormatter obj's underlying member method code with example usage: obj.format(record) and returns: super