[jboss-svn-commits] JBL Code SVN: r30969 - labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jan 7 09:28:13 EST 2010


Author: jhalliday
Date: 2010-01-07 09:28:13 -0500 (Thu, 07 Jan 2010)
New Revision: 30969

Modified:
   labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/LogFactory.java
Log:
Support delegation to i18n enabled loggers in CLF. JBTM-675


Modified: labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/LogFactory.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/LogFactory.java	2010-01-07 14:20:03 UTC (rev 30968)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/LogFactory.java	2010-01-07 14:28:13 UTC (rev 30969)
@@ -151,8 +151,16 @@
      */
     public static Logi18n getLogi18n(String name, String resBundle) {
         setupLogSystem();
-        LogInterface logInterface = m_logFactory.getLog(name);
-        Logi18n log = new Logi18nImpl(logInterface, resBundle, m_debugLevel, m_visLevel, m_facLevel);
+        Logi18n log;
+        if(m_logFactory.isInternationalizationSupported()) {
+            // TODO can all logging frameworks cope with having the same name used twice,
+            // once with and once without a resBundle?
+            Logi18nInterface logi18nInterface = m_logFactory.getLog(name, resBundle);
+            log = new Logi18nDelegatingImpl(logi18nInterface, resBundle, m_debugLevel, m_visLevel, m_facLevel);
+        } else {
+            LogInterface logInterface = m_logFactory.getLog(name);
+            log = new Logi18nImpl(logInterface, resBundle, m_debugLevel, m_visLevel, m_facLevel);
+        }
         return log;
     }
 



More information about the jboss-svn-commits mailing list