001: /*
002: * Copyright 2001-2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.apache.commons.logging.impl;
018:
019: import java.io.Serializable;
020: import org.apache.commons.logging.Log;
021:
022: /**
023: * <p>Trivial implementation of Log that throws away all messages. No
024: * configurable system properties are supported.</p>
025: *
026: * @author <a href="mailto:sanders@apache.org">Scott Sanders</a>
027: * @author Rod Waldhoff
028: * @version $Id: NoOpLog.java 155426 2005-02-26 13:10:49Z dirkv $
029: */
030: public class NoOpLog implements Log, Serializable {
031:
032: /** Convenience constructor */
033: public NoOpLog() {
034: }
035:
036: /** Base constructor */
037: public NoOpLog(String name) {
038: }
039:
040: /** Do nothing */
041: public void trace(Object message) {
042: }
043:
044: /** Do nothing */
045: public void trace(Object message, Throwable t) {
046: }
047:
048: /** Do nothing */
049: public void debug(Object message) {
050: }
051:
052: /** Do nothing */
053: public void debug(Object message, Throwable t) {
054: }
055:
056: /** Do nothing */
057: public void info(Object message) {
058: }
059:
060: /** Do nothing */
061: public void info(Object message, Throwable t) {
062: }
063:
064: /** Do nothing */
065: public void warn(Object message) {
066: }
067:
068: /** Do nothing */
069: public void warn(Object message, Throwable t) {
070: }
071:
072: /** Do nothing */
073: public void error(Object message) {
074: }
075:
076: /** Do nothing */
077: public void error(Object message, Throwable t) {
078: }
079:
080: /** Do nothing */
081: public void fatal(Object message) {
082: }
083:
084: /** Do nothing */
085: public void fatal(Object message, Throwable t) {
086: }
087:
088: /**
089: * Debug is never enabled.
090: *
091: * @return false
092: */
093: public final boolean isDebugEnabled() {
094: return false;
095: }
096:
097: /**
098: * Error is never enabled.
099: *
100: * @return false
101: */
102: public final boolean isErrorEnabled() {
103: return false;
104: }
105:
106: /**
107: * Fatal is never enabled.
108: *
109: * @return false
110: */
111: public final boolean isFatalEnabled() {
112: return false;
113: }
114:
115: /**
116: * Info is never enabled.
117: *
118: * @return false
119: */
120: public final boolean isInfoEnabled() {
121: return false;
122: }
123:
124: /**
125: * Trace is never enabled.
126: *
127: * @return false
128: */
129: public final boolean isTraceEnabled() {
130: return false;
131: }
132:
133: /**
134: * Warn is never enabled.
135: *
136: * @return false
137: */
138: public final boolean isWarnEnabled() {
139: return false;
140: }
141:
142: }
|