1/*
2 * Copyright 2001-2004 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17
18package org.apache.commons.logging.impl;
19
20
21import java.io.Serializable;
22import org.apache.commons.logging.Log;
23
24
25/**
26 * <p>Trivial implementation of Log that throws away all messages.  No
27 * configurable system properties are supported.</p>
28 *
29 * @author <a href="mailto:sanders@apache.org">Scott Sanders</a>
30 * @author Rod Waldhoff
31 * @version $Id: NoOpLog.java 155426 2005-02-26 13:10:49Z dirkv $
32 */
33public class NoOpLog implements Log, Serializable {
34
35    /** Convenience constructor */
36    public NoOpLog() { }
37    /** Base constructor */
38    public NoOpLog(String name) { }
39    /** Do nothing */
40    public void trace(Object message) { }
41    /** Do nothing */
42    public void trace(Object message, Throwable t) { }
43    /** Do nothing */
44    public void debug(Object message) { }
45    /** Do nothing */
46    public void debug(Object message, Throwable t) { }
47    /** Do nothing */
48    public void info(Object message) { }
49    /** Do nothing */
50    public void info(Object message, Throwable t) { }
51    /** Do nothing */
52    public void warn(Object message) { }
53    /** Do nothing */
54    public void warn(Object message, Throwable t) { }
55    /** Do nothing */
56    public void error(Object message) { }
57    /** Do nothing */
58    public void error(Object message, Throwable t) { }
59    /** Do nothing */
60    public void fatal(Object message) { }
61    /** Do nothing */
62    public void fatal(Object message, Throwable t) { }
63
64    /**
65     * Debug is never enabled.
66     *
67     * @return false
68     */
69    public final boolean isDebugEnabled() { return false; }
70
71    /**
72     * Error is never enabled.
73     *
74     * @return false
75     */
76    public final boolean isErrorEnabled() { return false; }
77
78    /**
79     * Fatal is never enabled.
80     *
81     * @return false
82     */
83    public final boolean isFatalEnabled() { return false; }
84
85    /**
86     * Info is never enabled.
87     *
88     * @return false
89     */
90    public final boolean isInfoEnabled() { return false; }
91
92    /**
93     * Trace is never enabled.
94     *
95     * @return false
96     */
97    public final boolean isTraceEnabled() { return false; }
98
99    /**
100     * Warn is never enabled.
101     *
102     * @return false
103     */
104    public final boolean isWarnEnabled() { return false; }
105
106}
107