code: def bacpypes_debugging(obj):
      
      # create a logger for this object
      logger = logging.getLogger(obj.__module__ + '.' + obj.__name__)
  
      # make it available to instances
      obj._logger = logger
      obj._debug = logger.debug
      obj._info = logger.info
      obj._warning = logger.warning
      obj._error = logger.error
      obj._exception = logger.exception
      obj._fatal = logger.fatal
  
      return obj
docs: Function for attaching a debugging logger to a class or function.