From: hansonr Date: Wed, 20 Jun 2018 09:38:38 +0000 (+0100) Subject: MessageManager logger to log4j X-Git-Tag: Release_2_11_4_0~45^2~18^2~685 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6c52a1ff889b6320dd8b3767c77b0555f818352f;p=jalview.git MessageManager logger to log4j --- diff --git a/src/jalview/util/MessageManager.java b/src/jalview/util/MessageManager.java index 3494181..71fc47a 100644 --- a/src/jalview/util/MessageManager.java +++ b/src/jalview/util/MessageManager.java @@ -23,8 +23,10 @@ package jalview.util; import java.text.MessageFormat; import java.util.Locale; import java.util.ResourceBundle; -import java.util.logging.Level; -import java.util.logging.Logger; +//import java.util.logging.Level; +//import java.util.logging.Logger; + +import org.apache.log4j.Logger; /** * @@ -36,6 +38,8 @@ import java.util.logging.Logger; public class MessageManager { + // BH 2018 switched to org.apache.llog4j.Logger + private static ResourceBundle rb; private static Logger log = Logger @@ -53,19 +57,19 @@ public class MessageManager /* Getting messages for GV */ log.info("Getting messages for lang: " + loc); rb = ResourceBundle.getBundle("lang.Messages", loc); - if (log.isLoggable(Level.FINEST)) - { - // this might take a while, so we only do it if it will be shown - log.finest("Language keys: " + rb.keySet()); - } + // if (log.isLoggable(Level.FINEST)) + // { + // // this might take a while, so we only do it if it will be shown + // log.info("Language keys: " + rb.keySet()); // was FINEST + // } } catch (Exception q) { - log.warning("Exception when initting Locale for i18n messages\n" + log.warn("Exception when initting Locale for i18n messages\n" + q.getMessage()); q.printStackTrace(); } catch (Error v) { - log.warning("Error when initting Locale for i18n messages\n" + log.warn("Error when initting Locale for i18n messages\n" + v.getMessage()); v.printStackTrace(); } @@ -80,7 +84,7 @@ public class MessageManager value = rb.getString(key); } catch (Exception e) { - log.warning("I18N missing: " + loc + "\t" + key); + log.warn("I18N missing: " + loc + "\t" + key); } return value; } @@ -119,8 +123,8 @@ public class MessageManager name = rb.getString(smkey); } catch (Exception x) { - log.finest("I18N missing key with root " + keyroot + ": " + loc + "\t" - + smkey); + log.info("I18N missing key with root " + keyroot + ": " + loc + "\t" + + smkey); // was FINEST } return name; }