[jboss-svn-commits] JBoss Common SVN: r2309 - common-old/branches/Branch_1_0/src/main/org/jboss/logging.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Mar 29 06:32:28 EDT 2007


Author: dimitris at jboss.org
Date: 2007-03-29 06:32:28 -0400 (Thu, 29 Mar 2007)
New Revision: 2309

Modified:
   common-old/branches/Branch_1_0/src/main/org/jboss/logging/Log4jLoggerPlugin.java
   common-old/branches/Branch_1_0/src/main/org/jboss/logging/XLevel.java
Log:
JBCOMMON-20, Map the jboss TRACE level logging to log4j TRACE

Modified: common-old/branches/Branch_1_0/src/main/org/jboss/logging/Log4jLoggerPlugin.java
===================================================================
--- common-old/branches/Branch_1_0/src/main/org/jboss/logging/Log4jLoggerPlugin.java	2007-03-29 10:32:04 UTC (rev 2308)
+++ common-old/branches/Branch_1_0/src/main/org/jboss/logging/Log4jLoggerPlugin.java	2007-03-29 10:32:28 UTC (rev 2309)
@@ -1,29 +1,29 @@
 /*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.logging;
 
-import org.apache.log4j.LogManager;
-import org.apache.log4j.Level;
 import org.apache.log4j.Category;
+import org.apache.log4j.Level;
+import org.apache.log4j.LogManager;
 import org.apache.log4j.Priority;
 
 /**
@@ -35,21 +35,7 @@
  *
  * @author  <a href="mailto:sacha.labourey at cogito-info.ch">Sacha Labourey</a>.
  * @version $Revision$
- *
- * <p><b>Revisions:</b>
- *
- * <p><b>3. mai 2002 Sacha Labourey:</b>
- * <ul>
- * <li> First implementation </li>
- * </ul>
- * </p>
- * <p><b>4. february 2003 Dag Liodden:</b>
- * <ul>
- *   <li>Fixed Log4J locationinfo by sending the fully qualified classname of <code>Logger</code> to Log4J</li>
- * </ul>
- * </p>
  */
-
 public class Log4jLoggerPlugin implements LoggerPlugin
 {
    
@@ -96,27 +82,28 @@
    
    public boolean isTraceEnabled()
    {      
-      if (log.isEnabledFor(XLevel.TRACE) == false)
+      Level l = Level.TRACE;
+      if (log.isEnabledFor(l) == false)
          return false;
-      return XLevel.TRACE.isGreaterOrEqual(log.getEffectiveLevel());
+      return l.isGreaterOrEqual(log.getEffectiveLevel());
    }
 
    /** 
     * Issue a log msg with a level of TRACE.
-    * Invokes log.log(XLevel.TRACE, message);
+    * Invokes log.log(Level.TRACE, message);
     */
    public void trace(Object message)
    {
-      log.log(FQCN, XLevel.TRACE, message, null);
+      log.log(FQCN, Level.TRACE, message, null);
    }
 
    /** 
     * Issue a log msg and throwable with a level of TRACE.
-    * Invokes log.log(XLevel.TRACE, message, t);
+    * Invokes log.log(Level.TRACE, message, t);
     */
    public void trace(Object message, Throwable t)
    {
-      log.log(FQCN, XLevel.TRACE, message, t);
+      log.log(FQCN, Level.TRACE, message, t);
    }
 
    /**

Modified: common-old/branches/Branch_1_0/src/main/org/jboss/logging/XLevel.java
===================================================================
--- common-old/branches/Branch_1_0/src/main/org/jboss/logging/XLevel.java	2007-03-29 10:32:04 UTC (rev 2308)
+++ common-old/branches/Branch_1_0/src/main/org/jboss/logging/XLevel.java	2007-03-29 10:32:28 UTC (rev 2309)
@@ -1,49 +1,47 @@
 /*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.logging;
 
 import org.apache.log4j.Level;
 
 /** 
  * Provides custom extention levels for use with the Log4j logging framework.
- *
  * <p>
  * Adds a trace level that is below the standard Log4j <tt>DEBUG</tt> level.
- *
  * <p>
- * This is a custom level that is 100 below the {@link Level#DEBUG_INT} 
+ * This is a custom level that is 100 below the {@link Level#TRACE_INT} 
  * and represents a lower level useful for logging events that should only
  * be displayed when deep debugging is required.
  *
  * @see org.apache.log4j.Level
- *
+ * @deprecated as log4j 1.2.14 has a native TRACE level
+ * 
  * @author  <a href="mailto:Scott.Stark at jboss.org">Scott Stark</a>
  * @version $Revision$
  */
-public class XLevel 
-   extends Level
+public class XLevel extends Level
 {
-   /** The integer representation of the level, ({@link Level#DEBUG_INT} - 100) */
-   public static final int TRACE_INT = Level.DEBUG_INT - 100;
+   /** The integer representation of the level, ({@link Level#TRACE_INT} - 100) */
+   public static final int TRACE_INT = Level.TRACE_INT - 100;
 
    /** The string name of the trace level. */
    public static final String TRACE_STR = "TRACE";




More information about the jboss-svn-commits mailing list