Interface DebugHandler


public interface DebugHandler
  • Method Details

    • enabled

      boolean enabled()
      Returns whether debug mode is enabled.
      Returns:
      whether debug mode is enabled
    • setEnabled

      void setEnabled(boolean enabled)
      Sets debug mode.
      Parameters:
      enabled - whether debug should be enabled
    • addPacketTypeNameToLog

      @Beta void addPacketTypeNameToLog(String packetTypeName)
      Adds a packet type name to the list of packet types to log.
      Parameters:
      packetTypeName - packet type name
    • addPacketTypeToLog

      @Beta void addPacketTypeToLog(PacketType packetType)
      Adds a packet id to the list of packet types to log. Packets will be checked on each protocol transformer, so this is best used on single protocol pipes.
      Parameters:
      packetType - packet type
    • removePacketTypeNameToLog

      @Beta boolean removePacketTypeNameToLog(String packetTypeName)
      Removes a packet type name from the list of packet types to log.
      Parameters:
      packetTypeName - packet type name
    • clearPacketTypesToLog

      @Beta void clearPacketTypesToLog()
      Resets packet type filters.
    • logPostPacketTransform

      @Beta boolean logPostPacketTransform()
      Returns whether packets should be logged after being transformed. Set to true by default.
      Returns:
      whether packets should be logged after being transformed
    • setLogPostPacketTransform

      @Beta void setLogPostPacketTransform(boolean logPostPacketTransform)
      Sets whether packets should be logged after being transformed.
      Parameters:
      logPostPacketTransform - whether packets should be logged after being transformed
    • shouldLog

      boolean shouldLog(PacketWrapper wrapper, Direction direction)
      Returns whether the given packet should be logged. If no specific packet type has been added, all packet types will be logged.
      Parameters:
      wrapper - packet wrapper
      direction - packet direction
      Returns:
      whether the packet should be logged
    • enableAndLogIds

      @Beta default void enableAndLogIds(PacketType... packetTypes)
    • error

      default void error(String error, Throwable t)
      Logs an error if debug mode is enabled or error suppression is disabled.
      Parameters:
      error - error message
      t - thrown exception