From d722c4972a55ec5ae4e347ab3e1d07554cf94f23 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 1 Jan 2021 10:40:08 +0200 Subject: [PATCH] initialise logger after configuring user defined application home --- drongo | 2 +- src/main/java/com/sparrowwallet/sparrow/MainApp.java | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drongo b/drongo index 05674097..962253be 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit 05674097428d25de043310f8ecddf06d998b3943 +Subproject commit 962253beaacfe36b5fb3261bae60b4e126406c19 diff --git a/src/main/java/com/sparrowwallet/sparrow/MainApp.java b/src/main/java/com/sparrowwallet/sparrow/MainApp.java index ad545a55..235c562b 100644 --- a/src/main/java/com/sparrowwallet/sparrow/MainApp.java +++ b/src/main/java/com/sparrowwallet/sparrow/MainApp.java @@ -28,8 +28,6 @@ import java.util.*; import java.util.stream.Collectors; public class MainApp extends Application { - private static final Logger log = LoggerFactory.getLogger(MainApp.class); - public static final String APP_NAME = "Sparrow"; public static final String APP_VERSION = "0.9.9"; public static final String APP_HOME_PROPERTY = "sparrow.home"; @@ -109,8 +107,8 @@ public class MainApp extends Application { } if(args.dir != null) { - log.info("Using configured Sparrow home folder of " + args.dir); System.setProperty(APP_HOME_PROPERTY, args.dir); + getLogger().info("Using configured Sparrow home folder of " + args.dir); } if(args.network != null) { @@ -121,7 +119,7 @@ public class MainApp extends Application { try { Network.set(Network.valueOf(envNetwork.toUpperCase())); } catch(Exception e) { - log.warn("Invalid " + NETWORK_ENV_PROPERTY + " property: " + envNetwork); + getLogger().warn("Invalid " + NETWORK_ENV_PROPERTY + " property: " + envNetwork); } } } @@ -132,9 +130,13 @@ public class MainApp extends Application { } if(Network.get() != Network.MAINNET) { - log.info("Using " + Network.get() + " configuration"); + getLogger().info("Using " + Network.get() + " configuration"); } com.sun.javafx.application.LauncherImpl.launchApplication(MainApp.class, MainAppPreloader.class, argv); } + + private static Logger getLogger() { + return LoggerFactory.getLogger(MainApp.class); + } }