• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
18 package org.apache.commons.logging.impl;
19 
20 
21 import java.io.Serializable;
22 import 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  */
33 public class NoOpLog implements Log, Serializable {
34 
35     /** Convenience constructor */
NoOpLog()36     public NoOpLog() { }
37     /** Base constructor */
NoOpLog(String name)38     public NoOpLog(String name) { }
39     /** Do nothing */
trace(Object message)40     public void trace(Object message) { }
41     /** Do nothing */
trace(Object message, Throwable t)42     public void trace(Object message, Throwable t) { }
43     /** Do nothing */
debug(Object message)44     public void debug(Object message) { }
45     /** Do nothing */
debug(Object message, Throwable t)46     public void debug(Object message, Throwable t) { }
47     /** Do nothing */
info(Object message)48     public void info(Object message) { }
49     /** Do nothing */
info(Object message, Throwable t)50     public void info(Object message, Throwable t) { }
51     /** Do nothing */
warn(Object message)52     public void warn(Object message) { }
53     /** Do nothing */
warn(Object message, Throwable t)54     public void warn(Object message, Throwable t) { }
55     /** Do nothing */
error(Object message)56     public void error(Object message) { }
57     /** Do nothing */
error(Object message, Throwable t)58     public void error(Object message, Throwable t) { }
59     /** Do nothing */
fatal(Object message)60     public void fatal(Object message) { }
61     /** Do nothing */
fatal(Object message, Throwable t)62     public void fatal(Object message, Throwable t) { }
63 
64     /**
65      * Debug is never enabled.
66      *
67      * @return false
68      */
isDebugEnabled()69     public final boolean isDebugEnabled() { return false; }
70 
71     /**
72      * Error is never enabled.
73      *
74      * @return false
75      */
isErrorEnabled()76     public final boolean isErrorEnabled() { return false; }
77 
78     /**
79      * Fatal is never enabled.
80      *
81      * @return false
82      */
isFatalEnabled()83     public final boolean isFatalEnabled() { return false; }
84 
85     /**
86      * Info is never enabled.
87      *
88      * @return false
89      */
isInfoEnabled()90     public final boolean isInfoEnabled() { return false; }
91 
92     /**
93      * Trace is never enabled.
94      *
95      * @return false
96      */
isTraceEnabled()97     public final boolean isTraceEnabled() { return false; }
98 
99     /**
100      * Warn is never enabled.
101      *
102      * @return false
103      */
isWarnEnabled()104     public final boolean isWarnEnabled() { return false; }
105 
106 }
107