From b9caff352b17badbf9c1ab314925b824a497b8c6 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 12 Mar 2021 18:12:42 +0200 Subject: [PATCH] actually quieten logs by redirecting jul logging to slf4j --- build.gradle | 3 +++ src/main/java/com/sparrowwallet/sparrow/MainApp.java | 3 +++ src/main/java/module-info.java | 1 + src/main/resources/logback.xml | 1 + 4 files changed, 8 insertions(+) diff --git a/build.gradle b/build.gradle index e5c796f9..9235a602 100644 --- a/build.gradle +++ b/build.gradle @@ -71,6 +71,9 @@ dependencies { } implementation('dev.bwt:bwt-jni:0.1.7') implementation('net.sourceforge.javacsv:javacsv:2.0') + implementation('org.slf4j:jul-to-slf4j:1.7.30') { + exclude group: 'org.slf4j' + } testImplementation('junit:junit:4.12') } diff --git a/src/main/java/com/sparrowwallet/sparrow/MainApp.java b/src/main/java/com/sparrowwallet/sparrow/MainApp.java index e2ed4d95..609c4e25 100644 --- a/src/main/java/com/sparrowwallet/sparrow/MainApp.java +++ b/src/main/java/com/sparrowwallet/sparrow/MainApp.java @@ -21,6 +21,7 @@ import javafx.stage.Stage; import org.controlsfx.glyphfont.GlyphFontRegistry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.slf4j.bridge.SLF4JBridgeHandler; import java.io.File; import java.util.*; @@ -156,6 +157,8 @@ public class MainApp extends Application { getLogger().info("Using " + Network.get() + " configuration"); } + SLF4JBridgeHandler.removeHandlersForRootLogger(); + SLF4JBridgeHandler.install(); com.sun.javafx.application.LauncherImpl.launchApplication(MainApp.class, MainAppPreloader.class, argv); } diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index eb4d6e91..d86bec74 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -28,4 +28,5 @@ open module com.sparrowwallet.sparrow { requires bwt.jni; requires jtorctl; requires javacsv; + requires jul.to.slf4j; } \ No newline at end of file diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index 1f00cf41..631b7e31 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -1,5 +1,6 @@ +