001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018
019 package org.apache.commons.logging.impl;
020
021
022 import java.io.Serializable;
023 import org.apache.commons.logging.Log;
024
025
026 /**
027 * <p>Trivial implementation of Log that throws away all messages. No
028 * configurable system properties are supported.</p>
029 *
030 * @author <a href="mailto:sanders@apache.org">Scott Sanders</a>
031 * @author Rod Waldhoff
032 * @version $Id: NoOpLog.java 424107 2006-07-20 23:15:42Z skitching $
033 */
034 public class NoOpLog implements Log, Serializable {
035
036 /** Convenience constructor */
037 public NoOpLog() { }
038 /** Base constructor */
039 public NoOpLog(String name) { }
040 /** Do nothing */
041 public void trace(Object message) { }
042 /** Do nothing */
043 public void trace(Object message, Throwable t) { }
044 /** Do nothing */
045 public void debug(Object message) { }
046 /** Do nothing */
047 public void debug(Object message, Throwable t) { }
048 /** Do nothing */
049 public void info(Object message) { }
050 /** Do nothing */
051 public void info(Object message, Throwable t) { }
052 /** Do nothing */
053 public void warn(Object message) { }
054 /** Do nothing */
055 public void warn(Object message, Throwable t) { }
056 /** Do nothing */
057 public void error(Object message) { }
058 /** Do nothing */
059 public void error(Object message, Throwable t) { }
060 /** Do nothing */
061 public void fatal(Object message) { }
062 /** Do nothing */
063 public void fatal(Object message, Throwable t) { }
064
065 /**
066 * Debug is never enabled.
067 *
068 * @return false
069 */
070 public final boolean isDebugEnabled() { return false; }
071
072 /**
073 * Error is never enabled.
074 *
075 * @return false
076 */
077 public final boolean isErrorEnabled() { return false; }
078
079 /**
080 * Fatal is never enabled.
081 *
082 * @return false
083 */
084 public final boolean isFatalEnabled() { return false; }
085
086 /**
087 * Info is never enabled.
088 *
089 * @return false
090 */
091 public final boolean isInfoEnabled() { return false; }
092
093 /**
094 * Trace is never enabled.
095 *
096 * @return false
097 */
098 public final boolean isTraceEnabled() { return false; }
099
100 /**
101 * Warn is never enabled.
102 *
103 * @return false
104 */
105 public final boolean isWarnEnabled() { return false; }
106
107 }