Data dumping could be made with filtering feature.
Currently a special logging filter is implemented. The filter dumps all the data to standard SLF4J logger.
NetCrusher crusher = DatagramCrusherBuilder.builder() // ... .withIncomingTransformFilterFactory((addr) -> new LoggingFilter(addr, "org.netcrusher.dump.incoming", LoggingFilter.Level.DEBUG)) .withOutgoingTransformFilterFactory((addr) -> new LoggingFilter(addr, "org.netcrusher.dump.outgoing", LoggingFilter.Level.DEBUG)) // ... buildAndOpen();
Produces the following output:
22:21:02.832 [NetCrusher selector event loop] DEBUG org.netcrusher.dump.outgoing - </127.0.0.1:59744> (0): 22:21:03.033 [NetCrusher selector event loop] DEBUG org.netcrusher.dump.incoming - </127.0.0.1:59744> (4): dbcb52a0