Interface DebugHandler
public interface DebugHandler
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPacketTypeNameToLog
(String packetTypeName) Adds a packet type name to the list of packet types to log.void
addPacketTypeToLog
(PacketType packetType) Adds a packet id to the list of packet types to log.void
Resets packet type filters.default void
enableAndLogIds
(PacketType... packetTypes) boolean
enabled()
Returns whether debug mode is enabled.default void
Logs an error if debug mode is enabled or error suppression is disabled.boolean
Returns whether packets should be logged after being transformed.boolean
removePacketTypeNameToLog
(String packetTypeName) Removes a packet type name from the list of packet types to log.void
setEnabled
(boolean enabled) Sets debug mode.void
setLogPostPacketTransform
(boolean logPostPacketTransform) Sets whether packets should be logged after being transformed.boolean
shouldLog
(PacketWrapper wrapper, Direction direction) Returns whether the given packet should be logged.
-
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
Adds a packet type name to the list of packet types to log.- Parameters:
packetTypeName
- packet type name
-
addPacketTypeToLog
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
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
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 wrapperdirection
- packet direction- Returns:
- whether the packet should be logged
-
enableAndLogIds
-
error
Logs an error if debug mode is enabled or error suppression is disabled.- Parameters:
error
- error messaget
- thrown exception
-