From 6c8ae6dcce6e9c16c28fad440054518128569f57 Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Mon, 23 Mar 2020 18:33:10 -0300 Subject: [PATCH] Suppress netty.shaded debug stack traces in cli Configure cli loggers to avoid scary but ignorable netty debug log messages with stack traces: "Reflective setAccessible(true)", and those showing unsuccessful netty native lib load attempts. It may be preferable to not use logback in cli, and achieve the same result programmatically with slf4j, but this shows how to hide this ugly log output in the meantime. Remove comment about why these messages were logged, and switch to non-deprecated ManagedChannelBuilder.forAddress(host, port) .usePlaintext().build() in BisqCliMain. --- cli/src/main/java/bisq/cli/app/BisqCliMain.java | 11 +++-------- cli/src/main/resources/logback.xml | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 cli/src/main/resources/logback.xml diff --git a/cli/src/main/java/bisq/cli/app/BisqCliMain.java b/cli/src/main/java/bisq/cli/app/BisqCliMain.java index 754a47fac43..e7badb284d9 100644 --- a/cli/src/main/java/bisq/cli/app/BisqCliMain.java +++ b/cli/src/main/java/bisq/cli/app/BisqCliMain.java @@ -57,10 +57,6 @@ /** * gRPC client. - * - * FIXME We get warning 'DEBUG io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0 - direct buffer constructor: unavailable - * java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled' which is - * related to Java 10 changes. Requests are working but we should find out why we get that warning */ @Slf4j public class BisqCliMain { @@ -80,10 +76,9 @@ public static void main(String[] args) throws Exception { } private BisqCliMain(String host, int port) { - this(ManagedChannelBuilder.forAddress(host, port) - // Channels are secure by default (via SSL/TLS). For the example we disable TLS to avoid - // needing certificates. - .usePlaintext(true).build()); + // Channels are secure by default (via SSL/TLS). For the example we disable TLS to avoid needing certificates. + this(ManagedChannelBuilder.forAddress(host, port).usePlaintext().build()); + // Simple input scanner // TODO use some more sophisticated input processing with validation.... diff --git a/cli/src/main/resources/logback.xml b/cli/src/main/resources/logback.xml new file mode 100644 index 00000000000..c5b1fcf9aa3 --- /dev/null +++ b/cli/src/main/resources/logback.xml @@ -0,0 +1,17 @@ + + + + + %highlight(%d{MMM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{30}: %msg %xEx%n) + + + + + + + + + + + +