001: /*
002: * Copyright (c) 2004-2005 SLF4J.ORG
003: * Copyright (c) 2004-2005 QOS.ch
004: *
005: * All rights reserved.
006: *
007: * Permission is hereby granted, free of charge, to any person obtaining
008: * a copy of this software and associated documentation files (the
009: * "Software"), to deal in the Software without restriction, including
010: * without limitation the rights to use, copy, modify, merge, publish,
011: * distribute, and/or sell copies of the Software, and to permit persons
012: * to whom the Software is furnished to do so, provided that the above
013: * copyright notice(s) and this permission notice appear in all copies of
014: * the Software and that both the above copyright notice(s) and this
015: * permission notice appear in supporting documentation.
016: *
017: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
018: * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
019: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
020: * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
021: * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
022: * SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
023: * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
024: * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
025: * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
026: *
027: * Except as contained in this notice, the name of a copyright holder
028: * shall not be used in advertising or otherwise to promote the sale, use
029: * or other dealings in this Software without prior written authorization
030: * of the copyright holder.
031: *
032: */
033:
034: package org.slf4j.impl;
035:
036: import org.slf4j.Logger;
037: import org.slf4j.helpers.MarkerIgnoringBase;
038:
039: /**
040: * A direct NOP (no operation) implementation of {@link Logger}.
041: *
042: * @author Ceki Gülcü
043: */
044: public class NOPLogger extends MarkerIgnoringBase {
045: /**
046: * The unique instance of NOPLogger.
047: */
048: public static final NOPLogger NOP_LOGGER = new NOPLogger();
049:
050: /**
051: * There is no point in creating multiple instances of NOPLOgger,
052: * except by derived classes, hence the protected access for the constructor.
053: */
054: protected NOPLogger() {
055: }
056:
057: /**
058: * Always returns the string value "NOP".
059: */
060: public String getName() {
061: return "NOP";
062: }
063:
064: /**
065: * Always returns false.
066: * @return always false
067: */
068: final public boolean isTraceEnabled() {
069: return false;
070: }
071:
072: /** A NOP implementation. */
073: final public void trace(String msg) {
074: // NOP
075: }
076:
077: /** A NOP implementation. */
078: final public void trace(String format, Object arg) {
079: // NOP
080: }
081:
082: /** A NOP implementation. */
083: public final void trace(String format, Object arg1, Object arg2) {
084: // NOP
085: }
086:
087: /** A NOP implementation. */
088: public final void trace(String format, Object[] argArray) {
089: // NOP
090: }
091:
092: /** A NOP implementation. */
093: final public void trace(String msg, Throwable t) {
094: // NOP
095: }
096:
097: /**
098: * Always returns false.
099: * @return always false
100: */
101: final public boolean isDebugEnabled() {
102: return false;
103: }
104:
105: /** A NOP implementation. */
106: final public void debug(String msg) {
107: // NOP
108: }
109:
110: /** A NOP implementation. */
111: final public void debug(String format, Object arg) {
112: // NOP
113: }
114:
115: /** A NOP implementation. */
116: public final void debug(String format, Object arg1, Object arg2) {
117: // NOP
118: }
119:
120: /** A NOP implementation. */
121: public final void debug(String format, Object[] argArray) {
122: // NOP
123: }
124:
125: /** A NOP implementation. */
126: final public void debug(String msg, Throwable t) {
127: // NOP
128: }
129:
130: /**
131: * Always returns false.
132: * @return always false
133: */
134: final public boolean isInfoEnabled() {
135: // NOP
136: return false;
137: }
138:
139: /** A NOP implementation. */
140: final public void info(String msg) {
141: // NOP
142: }
143:
144: /** A NOP implementation. */
145: final public void info(String format, Object arg1) {
146: // NOP
147: }
148:
149: /** A NOP implementation. */
150: final public void info(String format, Object arg1, Object arg2) {
151: // NOP
152: }
153:
154: /** A NOP implementation. */
155: public final void info(String format, Object[] argArray) {
156: // NOP
157: }
158:
159: /** A NOP implementation. */
160: final public void info(String msg, Throwable t) {
161: // NOP
162: }
163:
164: /**
165: * Always returns false.
166: * @return always false
167: */
168: final public boolean isWarnEnabled() {
169: return false;
170: }
171:
172: /** A NOP implementation. */
173: final public void warn(String msg) {
174: // NOP
175: }
176:
177: /** A NOP implementation. */
178: final public void warn(String format, Object arg1) {
179: // NOP
180: }
181:
182: /** A NOP implementation. */
183: final public void warn(String format, Object arg1, Object arg2) {
184: // NOP
185: }
186:
187: /** A NOP implementation. */
188: public final void warn(String format, Object[] argArray) {
189: // NOP
190: }
191:
192: /** A NOP implementation. */
193: final public void warn(String msg, Throwable t) {
194: // NOP
195: }
196:
197: /** A NOP implementation. */
198: final public boolean isErrorEnabled() {
199: return false;
200: }
201:
202: /** A NOP implementation. */
203: final public void error(String msg) {
204: // NOP
205: }
206:
207: /** A NOP implementation. */
208: final public void error(String format, Object arg1) {
209: // NOP
210: }
211:
212: /** A NOP implementation. */
213: final public void error(String format, Object arg1, Object arg2) {
214: // NOP
215: }
216:
217: /** A NOP implementation. */
218: public final void error(String format, Object[] argArray) {
219: // NOP
220: }
221:
222: /** A NOP implementation. */
223: final public void error(String msg, Throwable t) {
224: // NOP
225: }
226: }
|