1 /** 2 * Copyright (c) 2004-2011 QOS.ch 3 * All rights reserved. 4 * 5 * Permission is hereby granted, free of charge, to any person obtaining 6 * a copy of this software and associated documentation files (the 7 * "Software"), to deal in the Software without restriction, including 8 * without limitation the rights to use, copy, modify, merge, publish, 9 * distribute, sublicense, and/or sell copies of the Software, and to 10 * permit persons to whom the Software is furnished to do so, subject to 11 * the following conditions: 12 * 13 * The above copyright notice and this permission notice shall be 14 * included in all copies or substantial portions of the Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 * 24 */ 25 package org.slf4j.helpers; 26 27 import org.slf4j.Logger; 28 import org.slf4j.Marker; 29 30 /** 31 * This class serves as base for adapters or native implementations of logging systems 32 * lacking Marker support. In this implementation, methods taking marker data 33 * simply invoke the corresponding method without the Marker argument, discarding 34 * any marker data passed as argument. 35 * 36 * @author Ceki Gulcu 37 */ 38 public abstract class MarkerIgnoringBase extends NamedLoggerBase implements Logger { 39 40 private static final long serialVersionUID = 9044267456635152283L; 41 isTraceEnabled(Marker marker)42 public boolean isTraceEnabled(Marker marker) { 43 return isTraceEnabled(); 44 } 45 trace(Marker marker, String msg)46 public void trace(Marker marker, String msg) { 47 trace(msg); 48 } 49 trace(Marker marker, String format, Object arg)50 public void trace(Marker marker, String format, Object arg) { 51 trace(format, arg); 52 } 53 trace(Marker marker, String format, Object arg1, Object arg2)54 public void trace(Marker marker, String format, Object arg1, Object arg2) { 55 trace(format, arg1, arg2); 56 } 57 trace(Marker marker, String format, Object... arguments)58 public void trace(Marker marker, String format, Object... arguments) { 59 trace(format, arguments); 60 } 61 trace(Marker marker, String msg, Throwable t)62 public void trace(Marker marker, String msg, Throwable t) { 63 trace(msg, t); 64 } 65 isDebugEnabled(Marker marker)66 public boolean isDebugEnabled(Marker marker) { 67 return isDebugEnabled(); 68 } 69 debug(Marker marker, String msg)70 public void debug(Marker marker, String msg) { 71 debug(msg); 72 } 73 debug(Marker marker, String format, Object arg)74 public void debug(Marker marker, String format, Object arg) { 75 debug(format, arg); 76 } 77 debug(Marker marker, String format, Object arg1, Object arg2)78 public void debug(Marker marker, String format, Object arg1, Object arg2) { 79 debug(format, arg1, arg2); 80 } 81 debug(Marker marker, String format, Object... arguments)82 public void debug(Marker marker, String format, Object... arguments) { 83 debug(format, arguments); 84 } 85 debug(Marker marker, String msg, Throwable t)86 public void debug(Marker marker, String msg, Throwable t) { 87 debug(msg, t); 88 } 89 isInfoEnabled(Marker marker)90 public boolean isInfoEnabled(Marker marker) { 91 return isInfoEnabled(); 92 } 93 info(Marker marker, String msg)94 public void info(Marker marker, String msg) { 95 info(msg); 96 } 97 info(Marker marker, String format, Object arg)98 public void info(Marker marker, String format, Object arg) { 99 info(format, arg); 100 } 101 info(Marker marker, String format, Object arg1, Object arg2)102 public void info(Marker marker, String format, Object arg1, Object arg2) { 103 info(format, arg1, arg2); 104 } 105 info(Marker marker, String format, Object... arguments)106 public void info(Marker marker, String format, Object... arguments) { 107 info(format, arguments); 108 } 109 info(Marker marker, String msg, Throwable t)110 public void info(Marker marker, String msg, Throwable t) { 111 info(msg, t); 112 } 113 isWarnEnabled(Marker marker)114 public boolean isWarnEnabled(Marker marker) { 115 return isWarnEnabled(); 116 } 117 warn(Marker marker, String msg)118 public void warn(Marker marker, String msg) { 119 warn(msg); 120 } 121 warn(Marker marker, String format, Object arg)122 public void warn(Marker marker, String format, Object arg) { 123 warn(format, arg); 124 } 125 warn(Marker marker, String format, Object arg1, Object arg2)126 public void warn(Marker marker, String format, Object arg1, Object arg2) { 127 warn(format, arg1, arg2); 128 } 129 warn(Marker marker, String format, Object... arguments)130 public void warn(Marker marker, String format, Object... arguments) { 131 warn(format, arguments); 132 } 133 warn(Marker marker, String msg, Throwable t)134 public void warn(Marker marker, String msg, Throwable t) { 135 warn(msg, t); 136 } 137 isErrorEnabled(Marker marker)138 public boolean isErrorEnabled(Marker marker) { 139 return isErrorEnabled(); 140 } 141 error(Marker marker, String msg)142 public void error(Marker marker, String msg) { 143 error(msg); 144 } 145 error(Marker marker, String format, Object arg)146 public void error(Marker marker, String format, Object arg) { 147 error(format, arg); 148 } 149 error(Marker marker, String format, Object arg1, Object arg2)150 public void error(Marker marker, String format, Object arg1, Object arg2) { 151 error(format, arg1, arg2); 152 } 153 error(Marker marker, String format, Object... arguments)154 public void error(Marker marker, String format, Object... arguments) { 155 error(format, arguments); 156 } 157 error(Marker marker, String msg, Throwable t)158 public void error(Marker marker, String msg, Throwable t) { 159 error(msg, t); 160 } 161 toString()162 public String toString() { 163 return this.getClass().getName() + "(" + getName() + ")"; 164 } 165 166 } 167