From 09729b3346b885cc1ac2d8be0edc247bc9ee8d84 Mon Sep 17 00:00:00 2001 From: ribeaudc <ribeaudc> Date: Tue, 29 May 2007 09:13:16 +0000 Subject: [PATCH] Remove ExtendedLogger and avoid redundancy. SVN: 222 --- .../cisd/common/logging/ExtendedLogger.java | 73 ------------------- .../cisd/common/logging/LogFactory.java | 28 ------- 2 files changed, 101 deletions(-) delete mode 100644 common/source/java/ch/systemsx/cisd/common/logging/ExtendedLogger.java diff --git a/common/source/java/ch/systemsx/cisd/common/logging/ExtendedLogger.java b/common/source/java/ch/systemsx/cisd/common/logging/ExtendedLogger.java deleted file mode 100644 index 9903e5fb57f..00000000000 --- a/common/source/java/ch/systemsx/cisd/common/logging/ExtendedLogger.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2007 ETH Zuerich, CISD - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package ch.systemsx.cisd.common.logging; - -import org.apache.log4j.Logger; - -/** - * This <code>Logger</code> extension checks the priority level before making the logging output. - * - * @author Christian Ribeaud - */ -public final class ExtendedLogger extends Logger -{ - - public ExtendedLogger(String name) - { - super(name); - } - - /////////////////////////////////////////////////////// - // Logger - /////////////////////////////////////////////////////// - - @Override - public final void info(Object message) - { - if (isInfoEnabled()) - { - super.info(message); - } - } - - @Override - public final void info(Object message, Throwable t) - { - if (isInfoEnabled()) - { - super.info(message, t); - } - } - - @Override - public final void debug(Object message) - { - if (isDebugEnabled()) - { - super.debug(message); - } - } - - @Override - public final void debug(Object message, Throwable t) - { - if (isDebugEnabled()) - { - super.debug(message, t); - } - } -} diff --git a/common/source/java/ch/systemsx/cisd/common/logging/LogFactory.java b/common/source/java/ch/systemsx/cisd/common/logging/LogFactory.java index 1e357751586..6abc3ed49ec 100644 --- a/common/source/java/ch/systemsx/cisd/common/logging/LogFactory.java +++ b/common/source/java/ch/systemsx/cisd/common/logging/LogFactory.java @@ -17,7 +17,6 @@ package ch.systemsx.cisd.common.logging; import org.apache.log4j.Logger; -import org.apache.log4j.spi.LoggerFactory; /** * This class is used to create loggers (using <code>log4j</code>). @@ -49,31 +48,4 @@ public final class LogFactory { return Logger.getLogger(getLoggerName(category, clazz)); } - - /** - * Returns the logger for the given {@link LogCategory} and {@link Class}. The name of the logger will contain the - * name of the <var>category</var>, followed by the canonical name of <var>clazz</var>. - * <p> - * The returned version of <code>Logger</code> checks the priority level before doing the logging output. - * </p> - */ - public final static Logger getExtendedLogger(LogCategory category, Class clazz) { - return Logger.getLogger(getLoggerName(category, clazz), new ExtendedLoggerFactory()); - } - - /////////////////////////////////////////////////////// - // Helper Classes - /////////////////////////////////////////////////////// - - private final static class ExtendedLoggerFactory implements LoggerFactory { - - /////////////////////////////////////////////////////// - // LoggerFactory - /////////////////////////////////////////////////////// - - public Logger makeNewLoggerInstance(String name) - { - return new ExtendedLogger(name); - } - } } -- GitLab