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 * @deprecated Please use {@link java.net.URL#openConnection} instead. 34 * Please visit <a href="http://android-developers.blogspot.com/2011/09/androids-http-clients.html">this webpage</a> 35 * for further details. 36 */ 37 @Deprecated 38 public class NoOpLog implements Log, Serializable { 39 40 /** Convenience constructor */ NoOpLog()41 public NoOpLog() { } 42 /** Base constructor */ NoOpLog(String name)43 public NoOpLog(String name) { } 44 /** Do nothing */ trace(Object message)45 public void trace(Object message) { } 46 /** Do nothing */ trace(Object message, Throwable t)47 public void trace(Object message, Throwable t) { } 48 /** Do nothing */ debug(Object message)49 public void debug(Object message) { } 50 /** Do nothing */ debug(Object message, Throwable t)51 public void debug(Object message, Throwable t) { } 52 /** Do nothing */ info(Object message)53 public void info(Object message) { } 54 /** Do nothing */ info(Object message, Throwable t)55 public void info(Object message, Throwable t) { } 56 /** Do nothing */ warn(Object message)57 public void warn(Object message) { } 58 /** Do nothing */ warn(Object message, Throwable t)59 public void warn(Object message, Throwable t) { } 60 /** Do nothing */ error(Object message)61 public void error(Object message) { } 62 /** Do nothing */ error(Object message, Throwable t)63 public void error(Object message, Throwable t) { } 64 /** Do nothing */ fatal(Object message)65 public void fatal(Object message) { } 66 /** Do nothing */ fatal(Object message, Throwable t)67 public void fatal(Object message, Throwable t) { } 68 69 /** 70 * Debug is never enabled. 71 * 72 * @return false 73 */ isDebugEnabled()74 public final boolean isDebugEnabled() { return false; } 75 76 /** 77 * Error is never enabled. 78 * 79 * @return false 80 */ isErrorEnabled()81 public final boolean isErrorEnabled() { return false; } 82 83 /** 84 * Fatal is never enabled. 85 * 86 * @return false 87 */ isFatalEnabled()88 public final boolean isFatalEnabled() { return false; } 89 90 /** 91 * Info is never enabled. 92 * 93 * @return false 94 */ isInfoEnabled()95 public final boolean isInfoEnabled() { return false; } 96 97 /** 98 * Trace is never enabled. 99 * 100 * @return false 101 */ isTraceEnabled()102 public final boolean isTraceEnabled() { return false; } 103 104 /** 105 * Warn is never enabled. 106 * 107 * @return false 108 */ isWarnEnabled()109 public final boolean isWarnEnabled() { return false; } 110 111 } 112