From 014225ccc81b43fa06c1cba99b8934c71e65b8d9 Mon Sep 17 00:00:00 2001 From: James Procter Date: Fri, 20 Oct 2023 16:35:27 +0100 Subject: [PATCH] JAL-4298 reuse existing log level preference method --- src/jalview/gui/Console.java | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/jalview/gui/Console.java b/src/jalview/gui/Console.java index 960421f..b8aad21 100644 --- a/src/jalview/gui/Console.java +++ b/src/jalview/gui/Console.java @@ -217,30 +217,14 @@ public class Console extends WindowAdapter // logLevelCombo.addItem(LogLevel.ERROR); // logLevelCombo.addItem(LogLevel.OFF); // set startingLogLevel - if (jalview.bin.Console.log == null) + + if (jalview.bin.Console.getLogger() == null) { - try - { - startingLogLevel = LogLevel - .valueOf(Cache.getDefault(Cache.JALVIEWLOGLEVEL, null)); - } catch (IllegalArgumentException e1) - { - jalview.bin.Console.debug( - "Invalid value for preference " + Cache.JALVIEWLOGLEVEL); - } catch (NullPointerException e2) - { - // no value in preferences - } finally - { - if (startingLogLevel == null) - { - startingLogLevel = LogLevel.INFO; - } - } + startingLogLevel = jalview.bin.Console.getCachedLogLevel(); } else { - startingLogLevel = jalview.bin.Console.log.getLevel(); + startingLogLevel = jalview.bin.Console.getLogger().getLevel(); } setChosenLogLevelCombo(); logLevelCombo.addActionListener(new ActionListener() -- 1.7.10.2