From: James Procter Date: Fri, 20 Oct 2023 15:35:27 +0000 (+0100) Subject: JAL-4298 reuse existing log level preference method X-Git-Tag: Release_2_11_4_0~132^2~4 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=014225ccc81b43fa06c1cba99b8934c71e65b8d9;p=jalview.git JAL-4298 reuse existing log level preference method --- 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()