User: starksm
Date: 01/04/24 16:24:24
Modified: src/main/org/jboss/logging Log.java Logger.java
Added: src/main/org/jboss/logging LogToCategory.java
Log:
Deprecate the Log and Logger classes.
Add LogToCategory to allow users of a Log instance to
easily switch to log4j based Category logging.
Revision Changes Path
1.10 +5 -5 jboss/src/main/org/jboss/logging/Log.java
Index: Log.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/logging/Log.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Log.java 2001/04/11 13:37:46 1.9
+++ Log.java 2001/04/24 23:24:24 1.10
@@ -13,11 +13,11 @@
import java.util.*;
import javax.management.*;
-/**
- *
- * @see <related>
- * @author Rickard �berg ([EMAIL PROTECTED])
- * @version $Revision: 1.9 $
+/** The legacy JBoss logging framework base class.
+ * @deprecated, As of JBoss 2.3, replaced by the org.apache.log4j framework
+ * @author Rickard �berg ([EMAIL PROTECTED])
+ * @author [EMAIL PROTECTED]
+ * @version $Revision: 1.10 $
*/
public abstract class Log
{
1.8 +4 -4 jboss/src/main/org/jboss/logging/Logger.java
Index: Logger.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/logging/Logger.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Logger.java 2000/12/07 15:44:58 1.7
+++ Logger.java 2001/04/24 23:24:24 1.8
@@ -14,10 +14,10 @@
import javax.management.*;
/**
- *
- * @see <related>
- * @author Rickard �berg ([EMAIL PROTECTED])
- * @version $Revision: 1.7 $
+ * @deprecated, As of JBoss 2.3, replaced by the org.apache.log4j framework
+ * @author Rickard �berg ([EMAIL PROTECTED])
+ * @author [EMAIL PROTECTED]
+ * @version $Revision: 1.8 $
*/
public class Logger
extends NotificationBroadcasterSupport
1.1 jboss/src/main/org/jboss/logging/LogToCategory.java
Index: LogToCategory.java
===================================================================
/*
* jBoss, the OpenSource EJB server
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.logging;
import org.apache.log4j.Category;
/** An implementation of Log that routes msgs to a
log4j Category. This class is used to replace the Log
instances created via the legacy Log.createLog(Object)
@author [EMAIL PROTECTED]
@version $Revision: 1.1 $
*/
public class LogToCategory extends Log
{
private Category category;
public LogToCategory(Category category)
{
super(category.getName());
this.category = category;
}
public synchronized void log(String type, String message)
{
logToCategory(type, message, category);
}
/** Log a msg of a given Log type to the provided category.
@param type, one of the Log "Information", "Debug", "Warning", "Error" strings.
@param msg, the message to log
@param category, the log4j Category instance to log the msg to
*/
public static void logToCategory(String type, String msg, Category category)
{
char ctype = type.charAt(0);
switch( ctype )
{
case 'W':
category.warn(msg);
break;
case 'D':
category.debug(msg);
break;
case 'E':
category.error(msg);
break;
default:
category.info(msg);
break;
}
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development