Migrate to internal FormattingLogger in GCP proxy in preparation of migration to Flogger

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197199265
This commit is contained in:
jianglai 2018-05-18 14:18:52 -07:00
parent 053c52e0bd
commit 68b24f0a54
14 changed files with 18 additions and 17 deletions

View file

@ -20,8 +20,8 @@ import static google.registry.proxy.handler.ProxyProtocolHandler.REMOTE_ADDRESS_
import static google.registry.proxy.handler.SslServerInitializer.CLIENT_CERTIFICATE_PROMISE_KEY;
import static google.registry.util.X509Utils.getCertificateHash;
import com.google.common.logging.FormattingLogger;
import google.registry.proxy.metric.FrontendMetrics;
import google.registry.util.FormattingLogger;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelFuture;

View file

@ -17,8 +17,8 @@ package google.registry.proxy.handler;
import static com.google.common.base.Preconditions.checkArgument;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.common.logging.FormattingLogger;
import google.registry.proxy.metric.FrontendMetrics;
import google.registry.util.FormattingLogger;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerContext;

View file

@ -17,7 +17,7 @@ package google.registry.proxy.handler;
import static com.google.common.base.Preconditions.checkState;
import static java.nio.charset.StandardCharsets.US_ASCII;
import google.registry.util.FormattingLogger;
import com.google.common.logging.FormattingLogger;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;

View file

@ -16,7 +16,7 @@ package google.registry.proxy.handler;
import static com.google.common.base.Preconditions.checkNotNull;
import google.registry.util.FormattingLogger;
import com.google.common.logging.FormattingLogger;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerContext;
@ -47,7 +47,7 @@ public class RelayHandler<I> extends SimpleChannelInboundHandler<I> {
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
logger.severefmt(cause, "Inbound exception caught for channel %s", ctx.channel());
ctx.close();
ChannelFuture unusedFuture = ctx.close();
}
/** Close relay channel if this channel is closed. */
@ -55,7 +55,7 @@ public class RelayHandler<I> extends SimpleChannelInboundHandler<I> {
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
Channel relayChannel = ctx.channel().attr(RELAY_CHANNEL_KEY).get();
if (relayChannel != null) {
relayChannel.close();
ChannelFuture unusedFuture = relayChannel.close();
}
ctx.fireChannelInactive();
}
@ -72,12 +72,12 @@ public class RelayHandler<I> extends SimpleChannelInboundHandler<I> {
future -> {
// Cannot write into relay channel, close this channel.
if (!future.isSuccess()) {
ctx.close();
ChannelFuture unusedFuture = ctx.close();
}
});
} else {
// close this channel if the relay channel is closed.
ctx.close();
ChannelFuture unusedFuture = ctx.close();
}
}

View file

@ -17,9 +17,9 @@ package google.registry.proxy.handler;
import static com.google.common.base.Preconditions.checkNotNull;
import static google.registry.proxy.Protocol.PROTOCOL_KEY;
import com.google.common.logging.FormattingLogger;
import google.registry.proxy.HttpsRelayProtocolModule.HttpsRelayProtocol;
import google.registry.proxy.Protocol.BackendProtocol;
import google.registry.util.FormattingLogger;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandler.Sharable;
import io.netty.channel.ChannelInitializer;

View file

@ -14,8 +14,8 @@
package google.registry.proxy.handler;
import com.google.common.logging.FormattingLogger;
import google.registry.proxy.CertificateModule.EppCertificates;
import google.registry.util.FormattingLogger;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandler.Sharable;
import io.netty.channel.ChannelInitializer;