Index: lutinutil/src/java/org/codelutin/log/LutinLog.java diff -u lutinutil/src/java/org/codelutin/log/LutinLog.java:1.4 lutinutil/src/java/org/codelutin/log/LutinLog.java:1.5 --- lutinutil/src/java/org/codelutin/log/LutinLog.java:1.4 Mon Sep 18 10:02:09 2006 +++ lutinutil/src/java/org/codelutin/log/LutinLog.java Wed Jan 10 19:12:06 2007 @@ -23,9 +23,9 @@ * Created: 9 sept. 06 03:53:09 * * @author poussin - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * - * Last update: $Date: 2006/09/18 10:02:09 $ + * Last update: $Date: 2007/01/10 19:12:06 $ * by : $Author: bpoussin $ */ @@ -38,6 +38,7 @@ import javax.swing.SwingUtilities; import org.apache.commons.logging.Log; +import org.apache.commons.logging.impl.Log4JLogger; /** @@ -317,15 +318,16 @@ } public void user(Object msg) { - if(isInfoEnabled()) { - parent.info(msg); - } - fireLogEvent(LutinLogEvent.LogType.user, msg, null); + this.user(msg, null); } public void user(Object msg, Throwable eee) { if(isInfoEnabled()) { - parent.info(msg, eee); + if (parent instanceof Log4JLogger) { + Log4JWrapper.info(((Log4JLogger)parent), msg, eee); + } else { + parent.info(msg, eee); + } } fireLogEvent(LutinLogEvent.LogType.user, msg, eee); } @@ -334,15 +336,18 @@ * @see org.apache.commons.logging.Log#trace(java.lang.Object) */ public void trace(Object msg) { - parent.trace(msg); - fireLogEvent(LutinLogEvent.LogType.trace, msg, null); + this.trace(msg, null); } /* (non-Javadoc) * @see org.apache.commons.logging.Log#trace(java.lang.Object, java.lang.Throwable) */ public void trace(Object msg, Throwable eee) { - parent.trace(msg, eee); + if (parent instanceof Log4JLogger) { + Log4JWrapper.trace(((Log4JLogger)parent), msg, eee); + } else { + parent.trace(msg, eee); + } fireLogEvent(LutinLogEvent.LogType.trace, msg, eee); } @@ -350,15 +355,18 @@ * @see org.apache.commons.logging.Log#debug(java.lang.Object) */ public void debug(Object msg) { - parent.debug(msg); - fireLogEvent(LutinLogEvent.LogType.debug, msg, null); + this.debug(msg, null); } /* (non-Javadoc) * @see org.apache.commons.logging.Log#debug(java.lang.Object, java.lang.Throwable) */ public void debug(Object msg, Throwable eee) { - parent.debug(msg, eee); + if (parent instanceof Log4JLogger) { + Log4JWrapper.debug(((Log4JLogger)parent), msg, eee); + } else { + parent.debug(msg, eee); + } fireLogEvent(LutinLogEvent.LogType.debug, msg, eee); } @@ -366,15 +374,18 @@ * @see org.apache.commons.logging.Log#info(java.lang.Object) */ public void info(Object msg) { - parent.info(msg); - fireLogEvent(LutinLogEvent.LogType.info, msg, null); + this.info(msg, null); } /* (non-Javadoc) * @see org.apache.commons.logging.Log#info(java.lang.Object, java.lang.Throwable) */ public void info(Object msg, Throwable eee) { - parent.info(msg, eee); + if (parent instanceof Log4JLogger) { + Log4JWrapper.info(((Log4JLogger)parent), msg, eee); + } else { + parent.info(msg, eee); + } fireLogEvent(LutinLogEvent.LogType.info, msg, eee); } @@ -382,15 +393,18 @@ * @see org.apache.commons.logging.Log#warn(java.lang.Object) */ public void warn(Object msg) { - parent.warn(msg); - fireLogEvent(LutinLogEvent.LogType.warn, msg, null); + this.warn(msg, null); } /* (non-Javadoc) * @see org.apache.commons.logging.Log#warn(java.lang.Object, java.lang.Throwable) */ public void warn(Object msg, Throwable eee) { - parent.warn(msg, eee); + if (parent instanceof Log4JLogger) { + Log4JWrapper.warn(((Log4JLogger)parent), msg, eee); + } else { + parent.warn(msg, eee); + } fireLogEvent(LutinLogEvent.LogType.warn, msg, eee); } @@ -398,15 +412,18 @@ * @see org.apache.commons.logging.Log#error(java.lang.Object) */ public void error(Object msg) { - parent.error(msg); - fireLogEvent(LutinLogEvent.LogType.error, msg, null); + this.error(msg, null); } /* (non-Javadoc) * @see org.apache.commons.logging.Log#error(java.lang.Object, java.lang.Throwable) */ public void error(Object msg, Throwable eee) { - parent.error(msg, eee); + if (parent instanceof Log4JLogger) { + Log4JWrapper.error(((Log4JLogger)parent), msg, eee); + } else { + parent.error(msg, eee); + } fireLogEvent(LutinLogEvent.LogType.error, msg, eee); } @@ -414,15 +431,18 @@ * @see org.apache.commons.logging.Log#fatal(java.lang.Object) */ public void fatal(Object msg) { - parent.fatal(msg); - fireLogEvent(LutinLogEvent.LogType.fatal, msg, null); + this.fatal(msg, null); } /* (non-Javadoc) * @see org.apache.commons.logging.Log#fatal(java.lang.Object, java.lang.Throwable) */ public void fatal(Object msg, Throwable eee) { - parent.fatal(msg, eee); + if (parent instanceof Log4JLogger) { + Log4JWrapper.fatal(((Log4JLogger)parent), msg, eee); + } else { + parent.fatal(msg, eee); + } fireLogEvent(LutinLogEvent.LogType.fatal, msg, eee); }