001/* 002 * Copyright 2002-2017 the original author or authors. 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 * https://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 017package org.apache.commons.logging.impl; 018 019import java.io.Serializable; 020 021import org.apache.commons.logging.Log; 022 023/** 024 * Trivial implementation of {@link Log} that throws away all messages. 025 * 026 * @author Juergen Hoeller (for the {@code spring-jcl} variant) 027 * @since 5.0 028 */ 029@SuppressWarnings("serial") 030public class NoOpLog implements Log, Serializable { 031 032 public NoOpLog() { 033 } 034 035 public NoOpLog(String name) { 036 } 037 038 039 @Override 040 public boolean isFatalEnabled() { 041 return false; 042 } 043 044 @Override 045 public boolean isErrorEnabled() { 046 return false; 047 } 048 049 @Override 050 public boolean isWarnEnabled() { 051 return false; 052 } 053 054 @Override 055 public boolean isInfoEnabled() { 056 return false; 057 } 058 059 @Override 060 public boolean isDebugEnabled() { 061 return false; 062 } 063 064 @Override 065 public boolean isTraceEnabled() { 066 return false; 067 } 068 069 @Override 070 public void fatal(Object message) { 071 } 072 073 @Override 074 public void fatal(Object message, Throwable t) { 075 } 076 077 @Override 078 public void error(Object message) { 079 } 080 081 @Override 082 public void error(Object message, Throwable t) { 083 } 084 085 @Override 086 public void warn(Object message) { 087 } 088 089 @Override 090 public void warn(Object message, Throwable t) { 091 } 092 093 @Override 094 public void info(Object message) { 095 } 096 097 @Override 098 public void info(Object message, Throwable t) { 099 } 100 101 @Override 102 public void debug(Object message) { 103 } 104 105 @Override 106 public void debug(Object message, Throwable t) { 107 } 108 109 @Override 110 public void trace(Object message) { 111 } 112 113 @Override 114 public void trace(Object message, Throwable t) { 115 } 116 117}