From 96336cfbfd07b45a6b553da80ba9db16d0c2fb0e Mon Sep 17 00:00:00 2001 From: j2blake Date: Tue, 23 Apr 2013 17:28:46 -0400 Subject: [PATCH] Improve debug statements --- .../mannlib/vitro/webapp/i18n/I18nBundle.java | 13 ++++++++----- .../vitro/webapp/i18n/VitroResourceBundle.java | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/i18n/I18nBundle.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/i18n/I18nBundle.java index 7ea5acc3d..44b930089 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/i18n/I18nBundle.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/i18n/I18nBundle.java @@ -39,8 +39,9 @@ public class I18nBundle { public I18nBundle(String bundleName, ResourceBundle resources) { this(bundleName, resources, MESSAGE_KEY_NOT_FOUND); } - - private I18nBundle(String bundleName, ResourceBundle resources, String notFoundMessage) { + + private I18nBundle(String bundleName, ResourceBundle resources, + String notFoundMessage) { if (bundleName == null) { throw new IllegalArgumentException("bundleName may not be null"); } @@ -49,20 +50,22 @@ public class I18nBundle { } if (resources == null) { throw new NullPointerException("resources may not be null."); - }if (notFoundMessage == null) { + } + if (notFoundMessage == null) { throw new NullPointerException("notFoundMessage may not be null."); } this.bundleName = bundleName; this.resources = resources; this.notFoundMessage = notFoundMessage; } - + public String text(String key, Object... parameters) { - log.debug("Asking for '" + key + "' from bundle '" + bundleName + "'"); String textString; if (resources.containsKey(key)) { textString = resources.getString(key); + log.debug("In '" + bundleName + "', " + key + "='" + textString + + "')"); return formatString(textString, parameters); } else { String message = MessageFormat.format(notFoundMessage, bundleName, diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/i18n/VitroResourceBundle.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/i18n/VitroResourceBundle.java index c9b2b2acb..3d0640f30 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/i18n/VitroResourceBundle.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/i18n/VitroResourceBundle.java @@ -60,7 +60,7 @@ public class VitroResourceBundle extends ResourceBundle { return new VitroResourceBundle(bundleName, ctx, appI18nPath, themeI18nPath, control); } catch (FileNotFoundException e) { - log.debug(e); + log.info(e.getMessage()); return null; } catch (Exception e) { log.warn(e, e);