code: def on_log(self):
          # type: () -> Callable
          
          def decorator(handler):
              # type: (Callable) -> Callable
              self.client.on_log = handler
              return handler
  
          return decorator
docs: Decorate a callback function to handle MQTT logging.
  
          **Example Usage:**
  
          ::
  
              @mqtt.on_log()
              def handle_logging(client, userdata, level, buf):
                  print(client, userdata, level, buf)