    001/**
    002 * Copyright (c) 2004-2011 QOS.ch
    003 * All rights reserved.
    004 *
    005 * Permission is hereby granted, free  of charge, to any person obtaining
    006 * a  copy  of this  software  and  associated  documentation files  (the
    007 * "Software"), to  deal in  the Software without  restriction, including
    008 * without limitation  the rights to  use, copy, modify,  merge, publish,
    009 * distribute,  sublicense, and/or sell  copies of  the Software,  and to
    010 * permit persons to whom the Software  is furnished to do so, subject to
    011 * the following conditions:
    012 *
    013 * The  above  copyright  notice  and  this permission  notice  shall  be
    014 * included in all copies or substantial portions of the Software.
    015 *
    016 * THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
    017 * EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
    018 * MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
    019 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
    020 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    021 * OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
    022 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    023 *
    024 */
    025package org.slf4j.helpers;
    026
    027import org.slf4j.Logger;
    028import org.slf4j.Marker;
    029
    030/**
    031 * This class serves as base for adapters or native implementations of logging systems
    032 * lacking Marker support. In this implementation, methods taking marker data
    033 * simply invoke the corresponding method without the Marker argument, discarding
    034 * any marker data passed as argument.
    035 *
    036 * @author Ceki Gulcu
    037 */
    038public abstract class MarkerIgnoringBase extends NamedLoggerBase implements Logger {
    039
    040    private static final long serialVersionUID = 9044267456635152283L;
    041
    042    public boolean isTraceEnabled(Marker marker) {
    043        return isTraceEnabled();
    044    }
    045
    046    public void trace(Marker marker, String msg) {
    047        trace(msg);
    048    }
    049
    050    public void trace(Marker marker, String format, Object arg) {
    051        trace(format, arg);
    052    }
    053
    054    public void trace(Marker marker, String format, Object arg1, Object arg2) {
    055        trace(format, arg1, arg2);
    056    }
    057
    058    public void trace(Marker marker, String format, Object... arguments) {
    059        trace(format, arguments);
    060    }
    061
    062    public void trace(Marker marker, String msg, Throwable t) {
    063        trace(msg, t);
    064    }
    065
    066    public boolean isDebugEnabled(Marker marker) {
    067        return isDebugEnabled();
    068    }
    069
    070    public void debug(Marker marker, String msg) {
    071        debug(msg);
    072    }
    073
    074    public void debug(Marker marker, String format, Object arg) {
    075        debug(format, arg);
    076    }
    077
    078    public void debug(Marker marker, String format, Object arg1, Object arg2) {
    079        debug(format, arg1, arg2);
    080    }
    081
    082    public void debug(Marker marker, String format, Object... arguments) {
    083        debug(format, arguments);
    084    }
    085
    086    public void debug(Marker marker, String msg, Throwable t) {
    087        debug(msg, t);
    088    }
    089
    090    public boolean isInfoEnabled(Marker marker) {
    091        return isInfoEnabled();
    092    }
    093
    094    public void info(Marker marker, String msg) {
    095        info(msg);
    096    }
    097
    098    public void info(Marker marker, String format, Object arg) {
    099        info(format, arg);
    100    }
    101
    102    public void info(Marker marker, String format, Object arg1, Object arg2) {
    103        info(format, arg1, arg2);
    104    }
    105
    106    public void info(Marker marker, String format, Object... arguments) {
    107        info(format, arguments);
    108    }
    109
    110    public void info(Marker marker, String msg, Throwable t) {
    111        info(msg, t);
    112    }
    113
    114    public boolean isWarnEnabled(Marker marker) {
    115        return isWarnEnabled();
    116    }
    117
    118    public void warn(Marker marker, String msg) {
    119        warn(msg);
    120    }
    121
    122    public void warn(Marker marker, String format, Object arg) {
    123        warn(format, arg);
    124    }
    125
    126    public void warn(Marker marker, String format, Object arg1, Object arg2) {
    127        warn(format, arg1, arg2);
    128    }
    129
    130    public void warn(Marker marker, String format, Object... arguments) {
    131        warn(format, arguments);
    132    }
    133
    134    public void warn(Marker marker, String msg, Throwable t) {
    135        warn(msg, t);
    136    }
    137
    138    public boolean isErrorEnabled(Marker marker) {
    139        return isErrorEnabled();
    140    }
    141
    142    public void error(Marker marker, String msg) {
    143        error(msg);
    144    }
    145
    146    public void error(Marker marker, String format, Object arg) {
    147        error(format, arg);
    148    }
    149
    150    public void error(Marker marker, String format, Object arg1, Object arg2) {
    151        error(format, arg1, arg2);
    152    }
    153
    154    public void error(Marker marker, String format, Object... arguments) {
    155        error(format, arguments);
    156    }
    157
    158    public void error(Marker marker, String msg, Throwable t) {
    159        error(msg, t);
    160    }
    161
    162    public String toString() {
    163        return this.getClass().getName() + "(" + getName() + ")";
    164    }
    165
    166}