MarkerIgnoringBase xref

View Javadoc

    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  /**
    32   * This class serves as base for adapters or native implementations of logging systems
    33   * lacking Marker support. In this implementation, methods taking marker data
    34   * simply invoke the corresponding method without the Marker argument, discarding
    35   * any marker data passed as argument.
    36   *
    37   * @author Ceki Gulcu
    38   */
    39  public abstract class MarkerIgnoringBase extends NamedLoggerBase implements Logger {
    40
    41    private static final long serialVersionUID = 9044267456635152283L;
    42
    43    public boolean isTraceEnabled(Marker marker) {
    44      return isTraceEnabled();
    45    }
    46
    47    public void trace(Marker marker, String msg) {
    48      trace(msg);
    49    }
    50
    51    public void trace(Marker marker, String format, Object arg) {
    52      trace(format, arg);
    53    }
    54
    55    public void trace(Marker marker, String format, Object arg1, Object arg2) {
    56      trace(format, arg1, arg2);
    57    }
    58
    59    public void trace(Marker marker, String format, Object... arguments) {
    60      trace(format, arguments);
    61    }
    62
    63    public void trace(Marker marker, String msg, Throwable t) {
    64      trace(msg, t);
    65    }
    66
    67    public boolean isDebugEnabled(Marker marker) {
    68      return isDebugEnabled();
    69    }
    70
    71    public void debug(Marker marker, String msg) {
    72      debug(msg);
    73    }
    74
    75    public void debug(Marker marker, String format, Object arg) {
    76      debug(format, arg);
    77    }
    78
    79    public void debug(Marker marker, String format, Object arg1, Object arg2) {
    80      debug(format, arg1, arg2);
    81    }
    82
    83    public void debug(Marker marker, String format, Object... arguments) {
    84      debug(format, arguments);
    85    }
    86
    87    public void debug(Marker marker, String msg, Throwable t) {
    88      debug(msg, t);
    89    }
    90
    91    public boolean isInfoEnabled(Marker marker) {
    92      return isInfoEnabled();
    93    }
    94
    95    public void info(Marker marker, String msg) {
    96      info(msg);
    97    }
    98
    99    public void info(Marker marker, String format, Object arg) {
    100     info(format, arg);
    101   }
    102
    103   public void info(Marker marker, String format, Object arg1, Object arg2) {
    104     info(format, arg1, arg2);
    105   }
    106
    107   public void info(Marker marker, String format, Object... arguments) {
    108     info(format, arguments);
    109   }
    110
    111   public void info(Marker marker, String msg, Throwable t) {
    112     info(msg, t);
    113   }
    114
    115   public boolean isWarnEnabled(Marker marker) {
    116     return isWarnEnabled();
    117   }
    118
    119   public void warn(Marker marker, String msg) {
    120     warn(msg);
    121   }
    122
    123   public void warn(Marker marker, String format, Object arg) {
    124     warn(format, arg);
    125   }
    126
    127   public void warn(Marker marker, String format, Object arg1, Object arg2) {
    128     warn(format, arg1, arg2);
    129   }
    130
    131   public void warn(Marker marker, String format, Object... arguments) {
    132     warn(format, arguments);
    133   }
    134
    135   public void warn(Marker marker, String msg, Throwable t) {
    136     warn(msg, t);
    137   }
    138
    139
    140   public boolean isErrorEnabled(Marker marker) {
    141     return isErrorEnabled();
    142   }
    143
    144   public void error(Marker marker, String msg) {
    145     error(msg);
    146   }
    147
    148   public void error(Marker marker, String format, Object arg) {
    149     error(format, arg);
    150   }
    151
    152   public void error(Marker marker, String format, Object arg1, Object arg2) {
    153     error(format, arg1, arg2);
    154   }
    155
    156   public void error(Marker marker, String format, Object... arguments) {
    157     error(format, arguments);
    158   }
    159
    160   public void error(Marker marker, String msg, Throwable t) {
    161     error(msg, t);
    162   }
    163
    164   public String toString() {
    165 	  return this.getClass().getName()+"("+getName()+")";
    166   }
    167
    168 }