db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/util/logging Log4jLoggerImpl.java
Date Sat, 22 May 2004 11:23:36 GMT
arminw      2004/05/22 04:23:36

  Modified:    src/java/org/apache/ojb/broker/util/logging
                        Log4jLoggerImpl.java
  Log:
  use log4j class 'Level' instead of 'Priority' to be compatible
  with upcoming versions of log4j
  
  Revision  Changes    Path
  1.15      +29 -29    db-ojb/src/java/org/apache/ojb/broker/util/logging/Log4jLoggerImpl.java
  
  Index: Log4jLoggerImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/util/logging/Log4jLoggerImpl.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Log4jLoggerImpl.java	4 Apr 2004 23:53:38 -0000	1.14
  +++ Log4jLoggerImpl.java	22 May 2004 11:23:36 -0000	1.15
  @@ -20,7 +20,7 @@
   import java.util.HashMap;
   
   import org.apache.log4j.LogManager;
  -import org.apache.log4j.Priority;
  +import org.apache.log4j.Level;
   import org.apache.log4j.PropertyConfigurator;
   import org.apache.ojb.broker.util.configuration.Configuration;
   import org.apache.ojb.broker.util.configuration.ConfigurationException;
  @@ -55,11 +55,11 @@
   
   	static {
   		priorityMap = new HashMap();
  -		priorityMap.put(new Integer(Logger.DEBUG), Priority.DEBUG);
  -		priorityMap.put(new Integer(Logger.INFO), Priority.INFO);
  -		priorityMap.put(new Integer(Logger.WARN), Priority.WARN);
  -		priorityMap.put(new Integer(Logger.ERROR), Priority.ERROR);
  -		priorityMap.put(new Integer(Logger.FATAL), Priority.FATAL);
  +		priorityMap.put(new Integer(Logger.DEBUG), Level.DEBUG);
  +		priorityMap.put(new Integer(Logger.INFO), Level.INFO);
  +		priorityMap.put(new Integer(Logger.WARN), Level.WARN);
  +		priorityMap.put(new Integer(Logger.ERROR), Level.ERROR);
  +		priorityMap.put(new Integer(Logger.FATAL), Level.FATAL);
   	}
   
       /**
  @@ -152,7 +152,7 @@
   		return name;
   	}
   
  -	private Priority getPriority()
  +	private Level getLevel()
   	{
   		return getLogger().getEffectiveLevel();
   	}
  @@ -163,7 +163,7 @@
   	 */
   	public final void debug(Object pObject)
   	{
  -		getLogger().log(FQCN, Priority.DEBUG, pObject, null);
  +		getLogger().log(FQCN, Level.DEBUG, pObject, null);
   	}
   
   	/**
  @@ -172,7 +172,7 @@
   	 */
   	public final void info(Object pObject)
   	{
  -		getLogger().log(FQCN, Priority.INFO, pObject, null);
  +		getLogger().log(FQCN, Level.INFO, pObject, null);
   	}
   
   	/**
  @@ -181,7 +181,7 @@
   	 */
   	public final void warn(Object pObject)
   	{
  -		getLogger().log(FQCN, Priority.WARN, pObject, null);
  +		getLogger().log(FQCN, Level.WARN, pObject, null);
   	}
   
   	/**
  @@ -190,7 +190,7 @@
   	 */
   	public final void error(Object pObject)
   	{
  -		getLogger().log(FQCN, Priority.ERROR, pObject, null);
  +		getLogger().log(FQCN, Level.ERROR, pObject, null);
   	}
   
   	/**
  @@ -199,37 +199,37 @@
   	 */
   	public final void fatal(Object pObject)
   	{
  -		getLogger().log(FQCN, Priority.FATAL, pObject, null);
  +		getLogger().log(FQCN, Level.FATAL, pObject, null);
   	}
   
   	public void debug(Object message, Throwable obj)
   	{
  -		getLogger().log(FQCN, Priority.DEBUG, message, obj);
  +		getLogger().log(FQCN, Level.DEBUG, message, obj);
   	}
   
   	public void error(Object message, Throwable obj)
   	{
  -		getLogger().log(FQCN, Priority.ERROR, message, obj);
  +		getLogger().log(FQCN, Level.ERROR, message, obj);
   	}
   
   	public void fatal(Object message, Throwable obj)
   	{
  -		getLogger().log(FQCN, Priority.FATAL, message, obj);
  +		getLogger().log(FQCN, Level.FATAL, message, obj);
   	}
   
   	public void info(Object message, Throwable obj)
   	{
  -		getLogger().log(FQCN, Priority.INFO, message, obj);
  +		getLogger().log(FQCN, Level.INFO, message, obj);
   	}
   
   	public void warn(Object message, Throwable obj)
   	{
  -		getLogger().log(FQCN, Priority.WARN, message, obj);
  +		getLogger().log(FQCN, Level.WARN, message, obj);
   	}
   
   	public void safeDebug(String message, Object obj)
   	{
  -		if (Priority.DEBUG.isGreaterOrEqual(getPriority()))
  +		if (Level.DEBUG.isGreaterOrEqual(getLevel()))
   		{
   			String toString = null;
   			if (obj != null)
  @@ -249,7 +249,7 @@
   
   	public void safeDebug(String message, Object obj, Throwable throwable)
   	{
  -		if (Priority.DEBUG.isGreaterOrEqual(getPriority()))
  +		if (Level.DEBUG.isGreaterOrEqual(getLevel()))
   		{
   			String toString = null;
   			if (obj != null)
  @@ -269,7 +269,7 @@
   
   	public void safeInfo(String message, Object obj)
   	{
  -		if (Priority.INFO.isGreaterOrEqual(getPriority()))
  +		if (Level.INFO.isGreaterOrEqual(getLevel()))
   		{
   			String toString = null;
   			if (obj != null)
  @@ -289,7 +289,7 @@
   
   	public void safeInfo(String message, Object obj, Throwable throwable)
   	{
  -		if (Priority.INFO.isGreaterOrEqual(getPriority()))
  +		if (Level.INFO.isGreaterOrEqual(getLevel()))
   		{
   			String toString = null;
   			if (obj != null)
  @@ -309,7 +309,7 @@
   
   	public void safeWarn(String message, Object obj)
   	{
  -		if (Priority.WARN.isGreaterOrEqual(getPriority()))
  +		if (Level.WARN.isGreaterOrEqual(getLevel()))
   		{
   			String toString = null;
   			try
  @@ -326,7 +326,7 @@
   
   	public void safeWarn(String message, Object obj, Throwable throwable)
   	{
  -		if (Priority.WARN.isGreaterOrEqual(getPriority()))
  +		if (Level.WARN.isGreaterOrEqual(getLevel()))
   		{
   			String toString = null;
   			try
  @@ -343,7 +343,7 @@
   
   	public void safeError(String message, Object obj)
   	{
  -		if (Priority.ERROR.isGreaterOrEqual(getPriority()))
  +		if (Level.ERROR.isGreaterOrEqual(getLevel()))
   		{
   			String toString = null;
   			try
  @@ -360,7 +360,7 @@
   
   	public void safeError(String message, Object obj, Throwable throwable)
   	{
  -		if (Priority.ERROR.isGreaterOrEqual(getPriority()))
  +		if (Level.ERROR.isGreaterOrEqual(getLevel()))
   		{
   			String toString = null;
   			try
  @@ -377,7 +377,7 @@
   
   	public void safeFatal(String message, Object obj)
   	{
  -		if (Priority.FATAL.isGreaterOrEqual(getPriority()))
  +		if (Level.FATAL.isGreaterOrEqual(getLevel()))
   		{
   			String toString = null;
   			try
  @@ -394,7 +394,7 @@
   
   	public void safeFatal(String message, Object obj, Throwable throwable)
   	{
  -		if (Priority.FATAL.isGreaterOrEqual(getPriority()))
  +		if (Level.FATAL.isGreaterOrEqual(getLevel()))
   		{
   			String toString = null;
   			try
  @@ -416,7 +416,7 @@
   
   	public boolean isEnabledFor(int priority)
   	{
  -		return getLogger().isEnabledFor((Priority) priorityMap.get(new Integer(priority)));
  +		return getLogger().isEnabledFor((Level) priorityMap.get(new Integer(priority)));
   	}
   
   	/**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message