From 5cf91cf72eae1a4b9c89d597eee7e8eb765aebed Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Wed, 20 Apr 2016 20:53:19 -0700 Subject: [PATCH] retain logger instance to actually log things --- okcurl/src/main/java/okhttp3/curl/Main.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/okcurl/src/main/java/okhttp3/curl/Main.java b/okcurl/src/main/java/okhttp3/curl/Main.java index 91d1da7cd56c..5b2f371b0eba 100644 --- a/okcurl/src/main/java/okhttp3/curl/Main.java +++ b/okcurl/src/main/java/okhttp3/curl/Main.java @@ -57,6 +57,7 @@ public class Main extends HelpOption implements Runnable { static final String NAME = "okcurl"; static final int DEFAULT_TIMEOUT = -1; + private static Logger frameLogger; static Main fromArgs(String... args) { return SingleCommand.singleCommand(Main.class).parse(args); @@ -270,8 +271,8 @@ private static HostnameVerifier createInsecureHostnameVerifier() { } private static void enableHttp2FrameLogging() { - Logger logger = Logger.getLogger(Http2.class.getName() + "$FrameLogger"); - logger.setLevel(Level.FINE); + frameLogger = Logger.getLogger(Http2.class.getName() + "$FrameLogger"); + frameLogger.setLevel(Level.FINE); ConsoleHandler handler = new ConsoleHandler(); handler.setLevel(Level.FINE); handler.setFormatter(new SimpleFormatter() { @@ -279,6 +280,6 @@ private static void enableHttp2FrameLogging() { return String.format("%s%n", record.getMessage()); } }); - logger.addHandler(handler); + frameLogger.addHandler(handler); } }