diff --git a/docs/asciidoc/wire-logger.adoc b/docs/asciidoc/wire-logger.adoc index eb0e080784..3a4b1095f4 100644 --- a/docs/asciidoc/wire-logger.adoc +++ b/docs/asciidoc/wire-logger.adoc @@ -19,33 +19,33 @@ include::{examplesdir}/wiretap/Application.java[lines=18..35] ==== Wire Logger formatters Reactor Netty supports 3 different formatters: -- {javadoc}/reactor/netty5/transport/logging/AdvancedByteBufFormat.html#HEX_DUMP[AdvancedByteBufFormat#HEX_DUMP] - the default +- {javadoc}/reactor/netty5/transport/logging/AdvancedBufferFormat.html#HEX_DUMP[AdvancedBufferFormat#HEX_DUMP] - the default ==== [source,java,indent=0] -.{sourcedir}/reactor/netty5/transport/logging/AdvancedByteBufFormat.java +.{sourcedir}/reactor/netty5/transport/logging/AdvancedBufferFormat.java ---- -include::{formattersourcedir}/reactor/netty5/transport/logging/AdvancedByteBufFormat.java[lines=47..75] +include::{formattersourcedir}/reactor/netty5/transport/logging/AdvancedBufferFormat.java[lines=47..75] ---- ==== -- {javadoc}/reactor/netty5/transport/logging/AdvancedByteBufFormat.html#SIMPLE[AdvancedByteBufFormat#SIMPLE] +- {javadoc}/reactor/netty5/transport/logging/AdvancedBufferFormat.html#SIMPLE[AdvancedBufferFormat#SIMPLE] ==== [source,java,indent=0] -.{sourcedir}/reactor/netty5/transport/logging/AdvancedByteBufFormat.java +.{sourcedir}/reactor/netty5/transport/logging/AdvancedBufferFormat.java ---- -include::{formattersourcedir}/reactor/netty5/transport/logging/AdvancedByteBufFormat.java[lines=34..45] +include::{formattersourcedir}/reactor/netty5/transport/logging/AdvancedBufferFormat.java[lines=34..45] ---- ==== -- {javadoc}/reactor/netty5/transport/logging/AdvancedByteBufFormat.html#TEXTUAL[AdvancedByteBufFormat#TEXTUAL] +- {javadoc}/reactor/netty5/transport/logging/AdvancedBufferFormat.html#TEXTUAL[AdvancedBufferFormat#TEXTUAL] ==== [source,java,indent=0] -.{sourcedir}/reactor/netty5/transport/logging/AdvancedByteBufFormat.java +.{sourcedir}/reactor/netty5/transport/logging/AdvancedBufferFormat.java ---- -include::{formattersourcedir}/reactor/netty5/transport/logging/AdvancedByteBufFormat.java[lines=77..93] +include::{formattersourcedir}/reactor/netty5/transport/logging/AdvancedBufferFormat.java[lines=77..93] ---- ==== @@ -59,6 +59,6 @@ When you need to change the default formatter you can configure it as follows: include::{examplesdir}/wiretap/custom/Application.java[lines=18..38] ---- <1> Enables the wire logging, -{javadoc}/reactor/netty5/transport/logging/AdvancedByteBufFormat.html#TEXTUAL[AdvancedByteBufFormat#TEXTUAL] is used for +{javadoc}/reactor/netty5/transport/logging/AdvancedBufferFormat.html#TEXTUAL[AdvancedBufferFormat#TEXTUAL] is used for printing the content. ==== diff --git a/reactor-netty5-core/src/main/java/reactor/netty5/tcp/SslProvider.java b/reactor-netty5-core/src/main/java/reactor/netty5/tcp/SslProvider.java index cd1809ca54..34ab4cae0c 100644 --- a/reactor-netty5-core/src/main/java/reactor/netty5/tcp/SslProvider.java +++ b/reactor-netty5-core/src/main/java/reactor/netty5/tcp/SslProvider.java @@ -44,7 +44,7 @@ import reactor.core.Exceptions; import reactor.netty5.NettyPipeline; import reactor.netty5.ReactorNetty; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; import reactor.util.Logger; import reactor.util.Loggers; import reactor.util.annotation.Nullable; @@ -664,6 +664,6 @@ public void channelInboundEvent(ChannelHandlerContext ctx, Object evt) { static final Logger log = Loggers.getLogger(SslProvider.class); static final LoggingHandler LOGGING_HANDLER = - AdvancedByteBufFormat.HEX_DUMP + AdvancedBufferFormat.HEX_DUMP .toLoggingHandler("reactor.netty5.tcp.ssl", LogLevel.DEBUG, Charset.defaultCharset()); } diff --git a/reactor-netty5-core/src/main/java/reactor/netty5/tcp/TcpClientConfig.java b/reactor-netty5-core/src/main/java/reactor/netty5/tcp/TcpClientConfig.java index a3c946a6c3..df993255c2 100644 --- a/reactor-netty5-core/src/main/java/reactor/netty5/tcp/TcpClientConfig.java +++ b/reactor-netty5-core/src/main/java/reactor/netty5/tcp/TcpClientConfig.java @@ -29,7 +29,7 @@ import reactor.netty5.resources.ConnectionProvider; import reactor.netty5.resources.LoopResources; import reactor.netty5.transport.ClientTransportConfig; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; import reactor.util.annotation.Nullable; import java.net.SocketAddress; @@ -133,7 +133,7 @@ protected ChannelPipelineConfigurer defaultOnChannelInit() { static final ChannelOperations.OnSetup DEFAULT_OPS = (ch, c, msg) -> new ChannelOperations<>(ch, c); static final LoggingHandler LOGGING_HANDLER = - AdvancedByteBufFormat.HEX_DUMP + AdvancedBufferFormat.HEX_DUMP .toLoggingHandler(TcpClient.class.getName(), LogLevel.DEBUG, Charset.defaultCharset()); /** diff --git a/reactor-netty5-core/src/main/java/reactor/netty5/tcp/TcpServerConfig.java b/reactor-netty5-core/src/main/java/reactor/netty5/tcp/TcpServerConfig.java index 49c311140c..1d01b151b0 100644 --- a/reactor-netty5-core/src/main/java/reactor/netty5/tcp/TcpServerConfig.java +++ b/reactor-netty5-core/src/main/java/reactor/netty5/tcp/TcpServerConfig.java @@ -27,7 +27,7 @@ import reactor.netty5.channel.MicrometerChannelMetricsRecorder; import reactor.netty5.resources.LoopResources; import reactor.netty5.transport.ServerTransportConfig; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; import reactor.util.annotation.Nullable; import java.net.SocketAddress; @@ -113,7 +113,7 @@ protected ChannelPipelineConfigurer defaultOnChannelInit() { static final ChannelOperations.OnSetup DEFAULT_OPS = (ch, c, msg) -> new ChannelOperations<>(ch, c); static final LoggingHandler LOGGING_HANDLER = - AdvancedByteBufFormat.HEX_DUMP + AdvancedBufferFormat.HEX_DUMP .toLoggingHandler(TcpServer.class.getName(), LogLevel.DEBUG, Charset.defaultCharset()); /** diff --git a/reactor-netty5-core/src/main/java/reactor/netty5/transport/ProxyProvider.java b/reactor-netty5-core/src/main/java/reactor/netty5/transport/ProxyProvider.java index e30bd7f279..8bfb0bb66c 100644 --- a/reactor-netty5-core/src/main/java/reactor/netty5/transport/ProxyProvider.java +++ b/reactor-netty5-core/src/main/java/reactor/netty5/transport/ProxyProvider.java @@ -35,7 +35,7 @@ import io.netty.contrib.handler.proxy.Socks5ProxyHandler; import io.netty5.util.internal.StringUtil; import reactor.netty5.NettyPipeline; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; import reactor.util.annotation.Nullable; /** @@ -229,7 +229,7 @@ private boolean getNonProxyHostsValue() { } static final LoggingHandler LOGGING_HANDLER = - AdvancedByteBufFormat.HEX_DUMP + AdvancedBufferFormat.HEX_DUMP .toLoggingHandler("reactor.netty5.proxy", LogLevel.DEBUG, Charset.defaultCharset()); static final String HTTP_PROXY_HOST = "http.proxyHost"; diff --git a/reactor-netty5-core/src/main/java/reactor/netty5/transport/Transport.java b/reactor-netty5-core/src/main/java/reactor/netty5/transport/Transport.java index b88f073b0b..7508b2780d 100644 --- a/reactor-netty5-core/src/main/java/reactor/netty5/transport/Transport.java +++ b/reactor-netty5-core/src/main/java/reactor/netty5/transport/Transport.java @@ -34,7 +34,7 @@ import reactor.netty5.DisposableChannel; import reactor.netty5.channel.ChannelMetricsRecorder; import reactor.netty5.internal.util.Metrics; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; import reactor.netty5.resources.LoopResources; import reactor.util.Logger; import reactor.util.Loggers; @@ -282,7 +282,7 @@ public final T runOn(LoopResources loopResources, boolean preferNative, @Nullabl /** * Apply or remove a wire logger configuration using {@link Transport} category (logger), - * {@code DEBUG} logger level and {@link AdvancedByteBufFormat#HEX_DUMP} for {@link Buffer} format, + * {@code DEBUG} logger level and {@link AdvancedBufferFormat#HEX_DUMP} for {@link Buffer} format, * which means both events and content will be logged and the content will be in hex format. * * @param enable specifies whether the wire logger configuration will be added to the pipeline @@ -308,7 +308,7 @@ else if (configuration().loggingHandler != null) { /** * Apply a wire logger configuration using the specified category (logger), - * {@code DEBUG} logger level and {@link AdvancedByteBufFormat#HEX_DUMP} for {@link Buffer} format, + * {@code DEBUG} logger level and {@link AdvancedBufferFormat#HEX_DUMP} for {@link Buffer} format, * which means both events and content will be logged and the content will be in hex format. * * @param category the logger category @@ -321,7 +321,7 @@ public T wiretap(String category) { /** * Apply a wire logger configuration using the specified category (logger), - * logger level and {@link AdvancedByteBufFormat#HEX_DUMP} for {@link Buffer} format, + * logger level and {@link AdvancedBufferFormat#HEX_DUMP} for {@link Buffer} format, * which means both events and content will be logged and the content will be in hex format. * * @param category the logger category @@ -331,7 +331,7 @@ public T wiretap(String category) { public T wiretap(String category, LogLevel level) { Objects.requireNonNull(category, "category"); Objects.requireNonNull(level, "level"); - return wiretap(category, level, AdvancedByteBufFormat.HEX_DUMP); + return wiretap(category, level, AdvancedBufferFormat.HEX_DUMP); } /** @@ -339,20 +339,20 @@ public T wiretap(String category, LogLevel level) { * logger level and {@link Buffer} format. * Depending on the format: * - * When {@link AdvancedByteBufFormat#TEXTUAL} is specified, {@link Charset#defaultCharset()} will be used. + * When {@link AdvancedBufferFormat#TEXTUAL} is specified, {@link Charset#defaultCharset()} will be used. * * @param category the logger category * @param level the logger level * @param format the {@link Buffer} format * @return a new {@link Transport} reference */ - public final T wiretap(String category, LogLevel level, AdvancedByteBufFormat format) { + public final T wiretap(String category, LogLevel level, AdvancedBufferFormat format) { Objects.requireNonNull(category, "category"); Objects.requireNonNull(level, "level"); Objects.requireNonNull(format, "format"); @@ -362,14 +362,14 @@ public final T wiretap(String category, LogLevel level, AdvancedByteBufFormat fo /** * Apply a wire logger configuration using the specific category (logger), * logger level, {@link Buffer} format and charset. - * The charset is relevant in case of {@link AdvancedByteBufFormat#TEXTUAL} + * The charset is relevant in case of {@link AdvancedBufferFormat#TEXTUAL} * and a different charset than {@link Charset#defaultCharset()} is required. * Depending on the format: * * @@ -379,7 +379,7 @@ public final T wiretap(String category, LogLevel level, AdvancedByteBufFormat fo * @param charset the charset * @return a new {@link Transport} reference */ - public final T wiretap(String category, LogLevel level, AdvancedByteBufFormat format, Charset charset) { + public final T wiretap(String category, LogLevel level, AdvancedBufferFormat format, Charset charset) { Objects.requireNonNull(category, "category"); Objects.requireNonNull(level, "level"); Objects.requireNonNull(format, "format"); diff --git a/reactor-netty5-core/src/main/java/reactor/netty5/transport/logging/AdvancedByteBufFormat.java b/reactor-netty5-core/src/main/java/reactor/netty5/transport/logging/AdvancedBufferFormat.java similarity index 96% rename from reactor-netty5-core/src/main/java/reactor/netty5/transport/logging/AdvancedByteBufFormat.java rename to reactor-netty5-core/src/main/java/reactor/netty5/transport/logging/AdvancedBufferFormat.java index 544d767929..6ec0a30911 100644 --- a/reactor-netty5-core/src/main/java/reactor/netty5/transport/logging/AdvancedByteBufFormat.java +++ b/reactor-netty5-core/src/main/java/reactor/netty5/transport/logging/AdvancedBufferFormat.java @@ -25,12 +25,12 @@ /** * Used to control the format and verbosity of logging for {@link Buffer}s and {@link ByteBufHolder}s. *

- * Adds {@link AdvancedByteBufFormat#TEXTUAL} format to io.netty5.handler.logging.ByteBufFormat. + * Adds {@link AdvancedBufferFormat#TEXTUAL} format to {@link io.netty5.handler.logging.BufferFormat}. * * @author Maximilian Goeke * @since 1.0.0 */ -public enum AdvancedByteBufFormat { +public enum AdvancedBufferFormat { /** * When wire logging is enabled with this format, only the events will be logged. *

Examples:

@@ -98,7 +98,7 @@ public enum AdvancedByteBufFormat { * * @param category the logger category * @param level the logger level - * @param charset the charset (only relevant for {@link AdvancedByteBufFormat#TEXTUAL}) + * @param charset the charset (only relevant for {@link AdvancedBufferFormat#TEXTUAL}) * @return a new {@link LoggingHandler} reference */ public LoggingHandler toLoggingHandler(String category, LogLevel level, Charset charset) { diff --git a/reactor-netty5-core/src/main/java/reactor/netty5/transport/logging/ReactorNettyLoggingHandler.java b/reactor-netty5-core/src/main/java/reactor/netty5/transport/logging/ReactorNettyLoggingHandler.java index 406b2602d7..419592f242 100644 --- a/reactor-netty5-core/src/main/java/reactor/netty5/transport/logging/ReactorNettyLoggingHandler.java +++ b/reactor-netty5-core/src/main/java/reactor/netty5/transport/logging/ReactorNettyLoggingHandler.java @@ -33,15 +33,15 @@ import static io.netty.buffer.ByteBufUtil.appendPrettyHexDump; import static io.netty5.util.internal.StringUtil.NEWLINE; import static java.util.Objects.requireNonNull; -import static reactor.netty5.transport.logging.AdvancedByteBufFormat.HEX_DUMP; -import static reactor.netty5.transport.logging.AdvancedByteBufFormat.SIMPLE; -import static reactor.netty5.transport.logging.AdvancedByteBufFormat.TEXTUAL; +import static reactor.netty5.transport.logging.AdvancedBufferFormat.HEX_DUMP; +import static reactor.netty5.transport.logging.AdvancedBufferFormat.SIMPLE; +import static reactor.netty5.transport.logging.AdvancedBufferFormat.TEXTUAL; /** * Extends {@link LoggingHandler} in order to provide extended connection id, which in case of HTTP * adds the serial number of the request received on that connection. *

- * In case of {@link AdvancedByteBufFormat#TEXTUAL} logs all events in a + * In case of {@link AdvancedBufferFormat#TEXTUAL} logs all events in a * textual representation, so it's human readable and less verbose. *

* Hint: Logger escapes newlines as "\n" to reduce output. @@ -52,7 +52,7 @@ */ final class ReactorNettyLoggingHandler extends LoggingHandler { - private final AdvancedByteBufFormat byteBufFormat; + private final AdvancedBufferFormat bufferFormat; private final Charset charset; private final String name; @@ -61,18 +61,18 @@ final class ReactorNettyLoggingHandler extends LoggingHandler { * * @param name the name of the class to use for the logger * @param level the log level - * @param byteBufFormat the byte buffer format + * @param bufferFormat the byte buffer format */ - ReactorNettyLoggingHandler(String name, LogLevel level, AdvancedByteBufFormat byteBufFormat) { - super(name, level, byteBufFormat == SIMPLE ? BufferFormat.SIMPLE : BufferFormat.HEX_DUMP); - this.byteBufFormat = byteBufFormat; + ReactorNettyLoggingHandler(String name, LogLevel level, AdvancedBufferFormat bufferFormat) { + super(name, level, bufferFormat == SIMPLE ? BufferFormat.SIMPLE : BufferFormat.HEX_DUMP); + this.bufferFormat = bufferFormat; this.charset = null; this.name = name; } /** * Creates a new instance with the specified logger name, level and charset. - * The byte buffer format is {@link AdvancedByteBufFormat#TEXTUAL} + * The byte buffer format is {@link AdvancedBufferFormat#TEXTUAL} * * @param name the name of the class to use for the logger * @param level the log level @@ -80,24 +80,24 @@ final class ReactorNettyLoggingHandler extends LoggingHandler { */ ReactorNettyLoggingHandler(final String name, final LogLevel level, final Charset charset) { super(name, level); - this.byteBufFormat = TEXTUAL; + this.bufferFormat = TEXTUAL; this.charset = requireNonNull(charset, "charset"); this.name = name; } /* * The UnsupportedOperationException is thrown to reduce confusion. ReactorNettyLoggingHandler is using - * the AdvancedByteBufFormat and not ByteBufFormat. + * the AdvancedBufferFormat and not BufferFormat. */ @Override public BufferFormat bufferFormat() { - if (byteBufFormat == SIMPLE) { + if (bufferFormat == SIMPLE) { return BufferFormat.SIMPLE; } - else if (byteBufFormat == HEX_DUMP) { + else if (bufferFormat == HEX_DUMP) { return BufferFormat.HEX_DUMP; } - throw new UnsupportedOperationException("ReactorNettyLoggingHandler isn't using the classic ByteBufFormat."); + throw new UnsupportedOperationException("ReactorNettyLoggingHandler isn't using the classic BufferFormat."); } @Override @@ -108,7 +108,7 @@ public boolean equals(Object o) { if (!(o instanceof ReactorNettyLoggingHandler that)) { return false; } - return byteBufFormat == that.byteBufFormat && + return bufferFormat == that.bufferFormat && Objects.equals(charset, that.charset) && level() == that.level() && name.equals(that.name); @@ -116,7 +116,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(byteBufFormat, charset, level(), name); + return Objects.hash(bufferFormat, charset, level(), name); } @Override @@ -211,12 +211,12 @@ private String formatBuffer(ChannelHandlerContext ctx, String eventName, Buffer else { int outputLength = chStr.length() + 1 + eventName.length() + 2 + 10 + 1; String message = ""; - if (byteBufFormat == HEX_DUMP) { + if (bufferFormat == HEX_DUMP) { int rows = length / 16 + (length % 15 == 0 ? 0 : 1) + 4; int hexDumpLength = 2 + rows * 80; outputLength += hexDumpLength; } - else if (byteBufFormat == TEXTUAL) { + else if (bufferFormat == TEXTUAL) { message = msg.toString(charset); outputLength += message.length() + 1; } @@ -227,11 +227,11 @@ else if (byteBufFormat == TEXTUAL) { .append(": ") .append(length) .append('B'); - if (byteBufFormat == HEX_DUMP) { + if (bufferFormat == HEX_DUMP) { buf.append(NEWLINE); BufferUtil.appendPrettyHexDump(buf, msg); } - else if (byteBufFormat == TEXTUAL) { + else if (bufferFormat == TEXTUAL) { buf.append(' ').append(message); } @@ -256,9 +256,9 @@ private String formatByteBufHolder(ChannelHandlerContext ctx, String eventName, } else { StringBuilder buf; - if (byteBufFormat != TEXTUAL) { + if (bufferFormat != TEXTUAL) { int outputLength = chStr.length() + 1 + eventName.length() + 2 + msgStr.length() + 2 + 10 + 1; - if (byteBufFormat == HEX_DUMP) { + if (bufferFormat == HEX_DUMP) { int rows = length / 16 + (length % 15 == 0 ? 0 : 1) + 4; int hexDumpLength = 2 + rows * 80; outputLength += hexDumpLength; @@ -272,7 +272,7 @@ private String formatByteBufHolder(ChannelHandlerContext ctx, String eventName, .append(", ") .append(length) .append('B'); - if (byteBufFormat == HEX_DUMP) { + if (bufferFormat == HEX_DUMP) { buf.append(NEWLINE); appendPrettyHexDump(buf, content); } diff --git a/reactor-netty5-core/src/main/java/reactor/netty5/udp/UdpClientConfig.java b/reactor-netty5-core/src/main/java/reactor/netty5/udp/UdpClientConfig.java index 41467546cf..d3bd0fa802 100644 --- a/reactor-netty5-core/src/main/java/reactor/netty5/udp/UdpClientConfig.java +++ b/reactor-netty5-core/src/main/java/reactor/netty5/udp/UdpClientConfig.java @@ -29,7 +29,7 @@ import reactor.netty5.resources.ConnectionProvider; import reactor.netty5.resources.LoopResources; import reactor.netty5.transport.ClientTransportConfig; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; import java.net.ProtocolFamily; import java.net.SocketAddress; @@ -107,7 +107,7 @@ protected ServerChannelFactory serverConnectionFactory( static final ChannelOperations.OnSetup DEFAULT_OPS = (ch, c, msg) -> new UdpOperations(ch, c); static final LoggingHandler LOGGING_HANDLER = - AdvancedByteBufFormat.HEX_DUMP + AdvancedBufferFormat.HEX_DUMP .toLoggingHandler(UdpClient.class.getName(), LogLevel.DEBUG, Charset.defaultCharset()); static final class MicrometerUdpClientMetricsRecorder extends MicrometerChannelMetricsRecorder { diff --git a/reactor-netty5-core/src/main/java/reactor/netty5/udp/UdpServerConfig.java b/reactor-netty5-core/src/main/java/reactor/netty5/udp/UdpServerConfig.java index 8f3ba6d7ea..0cd7b2ddc6 100644 --- a/reactor-netty5-core/src/main/java/reactor/netty5/udp/UdpServerConfig.java +++ b/reactor-netty5-core/src/main/java/reactor/netty5/udp/UdpServerConfig.java @@ -32,7 +32,7 @@ import reactor.netty5.channel.MicrometerChannelMetricsRecorder; import reactor.netty5.resources.LoopResources; import reactor.netty5.transport.TransportConfig; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; import reactor.util.annotation.Nullable; import java.net.ProtocolFamily; @@ -154,7 +154,7 @@ protected ServerChannelFactory serverConnectionFactory( static final ChannelOperations.OnSetup DEFAULT_OPS = (ch, c, msg) -> new UdpOperations(ch, c); static final LoggingHandler LOGGING_HANDLER = - AdvancedByteBufFormat.HEX_DUMP + AdvancedBufferFormat.HEX_DUMP .toLoggingHandler(UdpServer.class.getName(), LogLevel.DEBUG, Charset.defaultCharset()); static final class MicrometerUdpServerMetricsRecorder extends MicrometerChannelMetricsRecorder { diff --git a/reactor-netty5-core/src/test/java/reactor/netty5/transport/TransportTest.java b/reactor-netty5-core/src/test/java/reactor/netty5/transport/TransportTest.java index 9b92f1339f..7b0a9719f5 100644 --- a/reactor-netty5-core/src/test/java/reactor/netty5/transport/TransportTest.java +++ b/reactor-netty5-core/src/test/java/reactor/netty5/transport/TransportTest.java @@ -31,7 +31,7 @@ import reactor.netty5.ChannelPipelineConfigurer; import reactor.netty5.ConnectionObserver; import reactor.netty5.channel.ChannelMetricsRecorder; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; import reactor.netty5.resources.LoopResources; /** @@ -49,18 +49,18 @@ void testWiretap() { doTestWiretap(transport.wiretap("category", LogLevel.DEBUG), LogLevel.DEBUG, BufferFormat.HEX_DUMP); doTestWiretap(transport.wiretap("category", LogLevel.INFO), LogLevel.INFO, BufferFormat.HEX_DUMP); doTestWiretap( - transport.wiretap("category", LogLevel.INFO, AdvancedByteBufFormat.HEX_DUMP), + transport.wiretap("category", LogLevel.INFO, AdvancedBufferFormat.HEX_DUMP), LogLevel.INFO, BufferFormat.HEX_DUMP); doTestWiretap( - transport.wiretap("category", LogLevel.DEBUG, AdvancedByteBufFormat.SIMPLE), + transport.wiretap("category", LogLevel.DEBUG, AdvancedBufferFormat.SIMPLE), LogLevel.DEBUG, BufferFormat.SIMPLE); doTestWiretapForTextualLogger( - transport.wiretap("category", LogLevel.DEBUG, AdvancedByteBufFormat.TEXTUAL), LogLevel.DEBUG); + transport.wiretap("category", LogLevel.DEBUG, AdvancedBufferFormat.TEXTUAL), LogLevel.DEBUG); doTestWiretapForTextualLogger( - transport.wiretap("category", LogLevel.DEBUG, AdvancedByteBufFormat.TEXTUAL, Charset.defaultCharset()), LogLevel.DEBUG); + transport.wiretap("category", LogLevel.DEBUG, AdvancedBufferFormat.TEXTUAL, Charset.defaultCharset()), LogLevel.DEBUG); } private void doTestWiretap(TestTransport transport, LogLevel expectedLevel, BufferFormat expectedFormat) { @@ -100,7 +100,7 @@ protected TestTransport duplicate() { static final class TestTransportConfig extends TransportConfig { static final LoggingHandler LOGGING_HANDLER = - AdvancedByteBufFormat.HEX_DUMP + AdvancedBufferFormat.HEX_DUMP .toLoggingHandler(TestTransport.class.getName(), LogLevel.DEBUG, Charset.defaultCharset()); TestTransportConfig(Map, ?> options) { diff --git a/reactor-netty5-core/src/test/java/reactor/netty5/transport/logging/AdvancedByteBufFormatTest.java b/reactor-netty5-core/src/test/java/reactor/netty5/transport/logging/AdvancedBufferFormatTest.java similarity index 88% rename from reactor-netty5-core/src/test/java/reactor/netty5/transport/logging/AdvancedByteBufFormatTest.java rename to reactor-netty5-core/src/test/java/reactor/netty5/transport/logging/AdvancedBufferFormatTest.java index b2b91ce773..e3e4eae3d1 100644 --- a/reactor-netty5-core/src/test/java/reactor/netty5/transport/logging/AdvancedByteBufFormatTest.java +++ b/reactor-netty5-core/src/test/java/reactor/netty5/transport/logging/AdvancedBufferFormatTest.java @@ -17,9 +17,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import static reactor.netty5.transport.logging.AdvancedByteBufFormat.HEX_DUMP; -import static reactor.netty5.transport.logging.AdvancedByteBufFormat.SIMPLE; -import static reactor.netty5.transport.logging.AdvancedByteBufFormat.TEXTUAL; +import static reactor.netty5.transport.logging.AdvancedBufferFormat.HEX_DUMP; +import static reactor.netty5.transport.logging.AdvancedBufferFormat.SIMPLE; +import static reactor.netty5.transport.logging.AdvancedBufferFormat.TEXTUAL; import java.nio.charset.Charset; @@ -28,13 +28,13 @@ import io.netty5.handler.logging.LogLevel; import io.netty5.handler.logging.LoggingHandler; -class AdvancedByteBufFormatTest { +class AdvancedBufferFormatTest { @Test void createSimpleLoggingHandler() { final LoggingHandler loggingHandler = SIMPLE.toLoggingHandler( - AdvancedByteBufFormatTest.class.toString(), + AdvancedBufferFormatTest.class.toString(), LogLevel.DEBUG, Charset.defaultCharset()); @@ -46,7 +46,7 @@ void createSimpleLoggingHandler() { void createHexDumpLoggingHandler() { final LoggingHandler loggingHandler = HEX_DUMP.toLoggingHandler( - AdvancedByteBufFormatTest.class.toString(), + AdvancedBufferFormatTest.class.toString(), LogLevel.DEBUG, Charset.defaultCharset()); @@ -58,7 +58,7 @@ void createHexDumpLoggingHandler() { void createTextualLoggingHandler() { final LoggingHandler loggingHandler = TEXTUAL.toLoggingHandler( - AdvancedByteBufFormatTest.class.toString(), + AdvancedBufferFormatTest.class.toString(), LogLevel.DEBUG, Charset.defaultCharset()); diff --git a/reactor-netty5-core/src/test/java/reactor/netty5/transport/logging/ReactorNettyLoggingHandlerTest.java b/reactor-netty5-core/src/test/java/reactor/netty5/transport/logging/ReactorNettyLoggingHandlerTest.java index 4342c67992..d3aaf96f8d 100644 --- a/reactor-netty5-core/src/test/java/reactor/netty5/transport/logging/ReactorNettyLoggingHandlerTest.java +++ b/reactor-netty5-core/src/test/java/reactor/netty5/transport/logging/ReactorNettyLoggingHandlerTest.java @@ -100,7 +100,7 @@ private void sendMessage(Object input, String expectedResult) { } @Test - void shouldThrowUnsupportedOperationExceptionWhenByteBufFormatIsCalled() { + void shouldThrowUnsupportedOperationExceptionWhenBufferFormatIsCalled() { assertThatExceptionOfType(UnsupportedOperationException.class) .isThrownBy(() -> defaultCharsetReactorNettyLoggingHandler.bufferFormat()); } diff --git a/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/http/client/wiretap/custom/Application.java b/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/http/client/wiretap/custom/Application.java index 26b0ac0c26..34e17ec016 100644 --- a/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/http/client/wiretap/custom/Application.java +++ b/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/http/client/wiretap/custom/Application.java @@ -17,14 +17,14 @@ import io.netty5.handler.logging.LogLevel; import reactor.netty5.http.client.HttpClient; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; public class Application { public static void main(String[] args) { HttpClient client = HttpClient.create() - .wiretap("logger-name", LogLevel.DEBUG, AdvancedByteBufFormat.TEXTUAL); //<1> + .wiretap("logger-name", LogLevel.DEBUG, AdvancedBufferFormat.TEXTUAL); //<1> client.get() .uri("https://example.com/") diff --git a/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/http/server/wiretap/custom/Application.java b/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/http/server/wiretap/custom/Application.java index 0d0cf45fdc..534586a8c8 100644 --- a/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/http/server/wiretap/custom/Application.java +++ b/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/http/server/wiretap/custom/Application.java @@ -18,14 +18,14 @@ import io.netty5.handler.logging.LogLevel; import reactor.netty5.DisposableServer; import reactor.netty5.http.server.HttpServer; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; public class Application { public static void main(String[] args) { DisposableServer server = HttpServer.create() - .wiretap("logger-name", LogLevel.DEBUG, AdvancedByteBufFormat.TEXTUAL) //<1> + .wiretap("logger-name", LogLevel.DEBUG, AdvancedBufferFormat.TEXTUAL) //<1> .bindNow(); server.onDispose() diff --git a/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/tcp/client/wiretap/custom/Application.java b/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/tcp/client/wiretap/custom/Application.java index 103dae80a4..ae5caedf12 100644 --- a/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/tcp/client/wiretap/custom/Application.java +++ b/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/tcp/client/wiretap/custom/Application.java @@ -18,14 +18,14 @@ import io.netty5.handler.logging.LogLevel; import reactor.netty5.Connection; import reactor.netty5.tcp.TcpClient; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; public class Application { public static void main(String[] args) { Connection connection = TcpClient.create() - .wiretap("logger-name", LogLevel.DEBUG, AdvancedByteBufFormat.TEXTUAL) //<1> + .wiretap("logger-name", LogLevel.DEBUG, AdvancedBufferFormat.TEXTUAL) //<1> .host("example.com") .port(80) .connectNow(); diff --git a/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/tcp/server/wiretap/custom/Application.java b/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/tcp/server/wiretap/custom/Application.java index 135a835119..6abfa6e1fc 100644 --- a/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/tcp/server/wiretap/custom/Application.java +++ b/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/tcp/server/wiretap/custom/Application.java @@ -18,14 +18,14 @@ import io.netty5.handler.logging.LogLevel; import reactor.netty5.DisposableServer; import reactor.netty5.tcp.TcpServer; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; public class Application { public static void main(String[] args) { DisposableServer server = TcpServer.create() - .wiretap("logger-name", LogLevel.DEBUG, AdvancedByteBufFormat.TEXTUAL) //<1> + .wiretap("logger-name", LogLevel.DEBUG, AdvancedBufferFormat.TEXTUAL) //<1> .bindNow(); server.onDispose() diff --git a/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/udp/client/wiretap/custom/Application.java b/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/udp/client/wiretap/custom/Application.java index d56b0927b2..6f487a1e20 100644 --- a/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/udp/client/wiretap/custom/Application.java +++ b/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/udp/client/wiretap/custom/Application.java @@ -17,7 +17,7 @@ import io.netty5.handler.logging.LogLevel; import reactor.netty5.Connection; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; import reactor.netty5.udp.UdpClient; import java.time.Duration; @@ -29,7 +29,7 @@ public static void main(String[] args) { UdpClient.create() .host("example.com") .port(80) - .wiretap("logger-name", LogLevel.DEBUG, AdvancedByteBufFormat.TEXTUAL) //<1> + .wiretap("logger-name", LogLevel.DEBUG, AdvancedBufferFormat.TEXTUAL) //<1> .connectNow(Duration.ofSeconds(30)); connection.onDispose() diff --git a/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/udp/server/wiretap/custom/Application.java b/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/udp/server/wiretap/custom/Application.java index 83bcc4e59b..44fe383766 100644 --- a/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/udp/server/wiretap/custom/Application.java +++ b/reactor-netty5-examples/src/main/java/reactor/netty5/examples/documentation/udp/server/wiretap/custom/Application.java @@ -17,7 +17,7 @@ import io.netty5.handler.logging.LogLevel; import reactor.netty5.Connection; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; import reactor.netty5.udp.UdpServer; import java.time.Duration; @@ -27,7 +27,7 @@ public class Application { public static void main(String[] args) { Connection server = UdpServer.create() - .wiretap("logger-name", LogLevel.DEBUG, AdvancedByteBufFormat.TEXTUAL) //<1> + .wiretap("logger-name", LogLevel.DEBUG, AdvancedBufferFormat.TEXTUAL) //<1> .bindNow(Duration.ofSeconds(30)); server.onDispose() diff --git a/reactor-netty5-http/src/main/java/reactor/netty5/http/client/HttpClientConfig.java b/reactor-netty5-http/src/main/java/reactor/netty5/http/client/HttpClientConfig.java index e699cfacd4..1eb4bc7db9 100644 --- a/reactor-netty5-http/src/main/java/reactor/netty5/http/client/HttpClientConfig.java +++ b/reactor-netty5-http/src/main/java/reactor/netty5/http/client/HttpClientConfig.java @@ -77,7 +77,7 @@ import reactor.netty5.tcp.SslProvider; import reactor.netty5.transport.ClientTransportConfig; import reactor.netty5.transport.ProxyProvider; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; import reactor.util.Logger; import reactor.util.Loggers; import reactor.util.annotation.Nullable; @@ -715,7 +715,7 @@ else if (metricsRecorder instanceof ContextAwareHttpClientMetricsRecorder contex static final Logger log = Loggers.getLogger(HttpClientConfig.class); static final LoggingHandler LOGGING_HANDLER = - AdvancedByteBufFormat.HEX_DUMP + AdvancedBufferFormat.HEX_DUMP .toLoggingHandler(HttpClient.class.getName(), LogLevel.DEBUG, Charset.defaultCharset()); /** diff --git a/reactor-netty5-http/src/main/java/reactor/netty5/http/server/HttpServerConfig.java b/reactor-netty5-http/src/main/java/reactor/netty5/http/server/HttpServerConfig.java index 5ee92f91d0..eb56b4ef09 100644 --- a/reactor-netty5-http/src/main/java/reactor/netty5/http/server/HttpServerConfig.java +++ b/reactor-netty5-http/src/main/java/reactor/netty5/http/server/HttpServerConfig.java @@ -62,7 +62,7 @@ import reactor.netty5.resources.LoopResources; import reactor.netty5.tcp.SslProvider; import reactor.netty5.transport.ServerTransportConfig; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; import reactor.util.Logger; import reactor.util.Loggers; import reactor.util.annotation.Nullable; @@ -699,7 +699,7 @@ else if (metricsRecorder instanceof ContextAwareHttpServerMetricsRecorder contex static final Logger log = Loggers.getLogger(HttpServerConfig.class); static final LoggingHandler LOGGING_HANDLER = - AdvancedByteBufFormat.HEX_DUMP + AdvancedBufferFormat.HEX_DUMP .toLoggingHandler(HttpServer.class.getName(), LogLevel.DEBUG, Charset.defaultCharset()); /** diff --git a/reactor-netty5-http/src/test/java/reactor/netty5/http/client/ConnectionPoolTests.java b/reactor-netty5-http/src/test/java/reactor/netty5/http/client/ConnectionPoolTests.java index 368adf0b32..ac507404d5 100644 --- a/reactor-netty5-http/src/test/java/reactor/netty5/http/client/ConnectionPoolTests.java +++ b/reactor-netty5-http/src/test/java/reactor/netty5/http/client/ConnectionPoolTests.java @@ -40,7 +40,7 @@ import reactor.netty5.http.server.HttpServer; import reactor.netty5.resources.ConnectionProvider; import reactor.netty5.resources.LoopResources; -import reactor.netty5.transport.logging.AdvancedByteBufFormat; +import reactor.netty5.transport.logging.AdvancedBufferFormat; import reactor.util.annotation.Nullable; import reactor.util.function.Tuple2; @@ -194,9 +194,9 @@ void testClientWithWiretapSameConfiguration() { HttpClient localClient1 = client.port(server1.port()) .wiretap("testClientWithWiretapSameConfiguration", LogLevel.DEBUG, - AdvancedByteBufFormat.TEXTUAL, Charset.defaultCharset()); + AdvancedBufferFormat.TEXTUAL, Charset.defaultCharset()); HttpClient localClient2 = localClient1.wiretap("testClientWithWiretapSameConfiguration", LogLevel.DEBUG, - AdvancedByteBufFormat.TEXTUAL, Charset.defaultCharset()); + AdvancedBufferFormat.TEXTUAL, Charset.defaultCharset()); checkResponsesAndChannelsStates( "server1-ConnectionPoolTests", "server1-ConnectionPoolTests", @@ -209,10 +209,10 @@ void testClientWithWiretapSameConfiguration() { void testDifferentClientWithWiretapSameConfiguration() { HttpClient localClient1 = client.port(server1.port()) - .wiretap("testClientWithWiretapSameConfiguration", LogLevel.DEBUG, AdvancedByteBufFormat.HEX_DUMP); + .wiretap("testClientWithWiretapSameConfiguration", LogLevel.DEBUG, AdvancedBufferFormat.HEX_DUMP); HttpClient localClient2 = client.port(server1.port()) - .wiretap("testClientWithWiretapSameConfiguration", LogLevel.DEBUG, AdvancedByteBufFormat.HEX_DUMP); + .wiretap("testClientWithWiretapSameConfiguration", LogLevel.DEBUG, AdvancedBufferFormat.HEX_DUMP); checkResponsesAndChannelsStates( "server1-ConnectionPoolTests", "server1-ConnectionPoolTests",