Index: lutinutil/src/java/org/codelutin/log/Log4JWrapper.java diff -u /dev/null lutinutil/src/java/org/codelutin/log/Log4JWrapper.java:1.1 --- /dev/null Wed Jan 10 19:12:49 2007 +++ lutinutil/src/java/org/codelutin/log/Log4JWrapper.java Wed Jan 10 19:12:44 2007 @@ -0,0 +1,69 @@ +/* *##% + * Copyright (C) 2007 + * Code Lutin, Benjamin Poussin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * Log4JWrapper.java + * + * Created: 10 janv. 07 17:07:54 + * + * @author poussin + * @version $Revision: 1.1 $ + * + * Last update: $Date: 2007/01/10 19:12:44 $ + * by : $Author: bpoussin $ + */ + +package org.codelutin.log; + +import org.apache.commons.logging.impl.Log4JLogger; +import org.apache.log4j.Level; + + +/** + * Cette classe n'est utile que parce qu'on ne peut pas modifier le FQCN present + * dans {@link Log4JLogger}. Donc sans cette classe on n'a pas le bon nom + * de classe.method et numero de ligne dans la sortie du log. + * + * @author poussin + */ +public class Log4JWrapper { + + final static private String FQCN = LutinLog.class.getName() + "."; + + static public void fatal(Log4JLogger log, Object msg, Throwable eee) { + log.getLogger().log(FQCN, Level.FATAL, msg, eee); + } + static public void error(Log4JLogger log, Object msg, Throwable eee) { + log.getLogger().log(FQCN, Level.ERROR, msg, eee); + } + static public void warn(Log4JLogger log, Object msg, Throwable eee) { + log.getLogger().log(FQCN, Level.WARN, msg, eee); + } + static public void info(Log4JLogger log, Object msg, Throwable eee) { + log.getLogger().log(FQCN, Level.INFO, msg, eee); + } + static public void debug(Log4JLogger log, Object msg, Throwable eee) { + log.getLogger().log(FQCN, Level.DEBUG, msg, eee); + } + static public void trace(Log4JLogger log, Object msg, Throwable eee) { + log.getLogger().log(FQCN, Level.TRACE, msg, eee); + } +} + +