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   * 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
    42      public boolean isTraceEnabled(Marker marker) {
    43          return isTraceEnabled();
    44      }
    45
    46      public void trace(Marker marker, String msg) {
    47          trace(msg);
    48      }
    49
    50      public void trace(Marker marker, String format, Object arg) {
    51          trace(format, arg);
    52      }
    53
    54      public void trace(Marker marker, String format, Object arg1, Object arg2) {
    55          trace(format, arg1, arg2);
    56      }
    57
    58      public void trace(Marker marker, String format, Object... arguments) {
    59          trace(format, arguments);
    60      }
    61
    62      public void trace(Marker marker, String msg, Throwable t) {
    63          trace(msg, t);
    64      }
    65
    66      public boolean isDebugEnabled(Marker marker) {
    67          return isDebugEnabled();
    68      }
    69
    70      public void debug(Marker marker, String msg) {
    71          debug(msg);
    72      }
    73
    74      public void debug(Marker marker, String format, Object arg) {
    75          debug(format, arg);
    76      }
    77
    78      public void debug(Marker marker, String format, Object arg1, Object arg2) {
    79          debug(format, arg1, arg2);
    80      }
    81
    82      public void debug(Marker marker, String format, Object... arguments) {
    83          debug(format, arguments);
    84      }
    85
    86      public void debug(Marker marker, String msg, Throwable t) {
    87          debug(msg, t);
    88      }
    89
    90      public boolean isInfoEnabled(Marker marker) {
    91          return isInfoEnabled();
    92      }
    93
    94      public void info(Marker marker, String msg) {
    95          info(msg);
    96      }
    97
    98      public void info(Marker marker, String format, Object arg) {
    99          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 }