Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package org.apache.commons.logging.impl;
 
 
Implementation of org.apache.commons.logging.Log interface which delegates all processing to a wrapped org.slf4j.Logger instance.

JCL's FATAL level is mapped to ERROR. All other levels map one to one.

Author(s):
Ceki Gülcü
 
 public class SLF4JLocationAwareLog implements LogSerializable {
 
   private static final long serialVersionUID = -2379157579039314822L;
 
   // used to store this logger's name to recreate it after serialization
   protected String name;
 
   // in both Log4jLogger and Jdk14Logger classes in the original JCL, the
   // logger instance is transient
   private transient LocationAwareLogger logger;
 
   private static final String FQCN = SLF4JLocationAwareLog.class.getName();
 
     this. = logger;
     this. = logger.getName();
   }

  
Delegates to the isTraceEnabled method of the wrapped org.slf4j.Logger instance.
 
   public boolean isTraceEnabled() {
     return .isTraceEnabled();
   }

  
Directly delegates to the wrapped org.slf4j.Logger instance.
 
   public boolean isDebugEnabled() {
     return .isDebugEnabled();
   }

  
Directly delegates to the wrapped org.slf4j.Logger instance.
 
   public boolean isInfoEnabled() {
     return .isInfoEnabled();
   }

  
Directly delegates to the wrapped org.slf4j.Logger instance.
 
   public boolean isWarnEnabled() {
     return .isWarnEnabled();
   }

  
Directly delegates to the wrapped org.slf4j.Logger instance.
 
   public boolean isErrorEnabled() {
     return .isErrorEnabled();
   }

  
Delegates to the isErrorEnabled method of the wrapped org.slf4j.Logger instance.
 
   public boolean isFatalEnabled() {
     return .isErrorEnabled();
   }

  
Converts the input parameter to String and then delegates to the debug method of the wrapped org.slf4j.Logger instance.

Parameters:
message the message to log. Converted to java.lang.String
  public void trace(Object message) {
    .log(null., String
        .valueOf(message), nullnull);
  }

  
Converts the first input parameter to String and then delegates to the debug method of the wrapped org.slf4j.Logger instance.

Parameters:
message the message to log. Converted to java.lang.String
t the exception to log
  public void trace(Object messageThrowable t) {
    .log(null., String
        .valueOf(message), nullt);
  }

  
Converts the input parameter to String and then delegates to the wrapped org.slf4j.Logger instance.

Parameters:
message the message to log. Converted to java.lang.String
  public void debug(Object message) {
    .log(null., String
        .valueOf(message), nullnull);
  }

  
Converts the first input parameter to String and then delegates to the wrapped org.slf4j.Logger instance.

Parameters:
message the message to log. Converted to java.lang.String
t the exception to log
  public void debug(Object messageThrowable t) {
    .log(null., String
        .valueOf(message), nullt);
  }

  
Converts the input parameter to String and then delegates to the wrapped org.slf4j.Logger instance.

Parameters:
message the message to log. Converted to java.lang.String
  public void info(Object message) {
    .log(null., String
        .valueOf(message), nullnull);
  }

  
Converts the first input parameter to String and then delegates to the wrapped org.slf4j.Logger instance.

Parameters:
message the message to log. Converted to java.lang.String
t the exception to log
  public void info(Object messageThrowable t) {
    .log(null., String
        .valueOf(message), nullt);
  }

  
Converts the input parameter to String and then delegates to the wrapped org.slf4j.Logger instance.

Parameters:
message the message to log. Converted to java.lang.String
  public void warn(Object message) {
    .log(null., String
        .valueOf(message), nullnull);
  }

  
Converts the first input parameter to String and then delegates to the wrapped org.slf4j.Logger instance.

Parameters:
message the message to log. Converted to java.lang.String
t the exception to log
  public void warn(Object messageThrowable t) {
    .log(null., String
        .valueOf(message), nullt);
  }

  
Converts the input parameter to String and then delegates to the wrapped org.slf4j.Logger instance.

Parameters:
message the message to log. Converted to java.lang.String
  public void error(Object message) {
    .log(null., String
        .valueOf(message), nullnull);
  }

  
Converts the first input parameter to String and then delegates to the wrapped org.slf4j.Logger instance.

Parameters:
message the message to log. Converted to java.lang.String
t the exception to log
  public void error(Object messageThrowable t) {
    .log(null., String
        .valueOf(message), nullt);
  }

  
Converts the input parameter to String and then delegates to the error method of the wrapped org.slf4j.Logger instance.

Parameters:
message the message to log. Converted to java.lang.String
  public void fatal(Object message) {
    .log(null., String
        .valueOf(message), nullnull);
  }

  
Converts the first input parameter to String and then delegates to the error method of the wrapped org.slf4j.Logger instance.

Parameters:
message the message to log. Converted to java.lang.String
t the exception to log
  public void fatal(Object messageThrowable t) {
    .log(null., String
        .valueOf(message), nullt);
  }

  
Replace this instance with a homonymous (same name) logger returned by LoggerFactory. Note that this method is only called during deserialization.

Returns:
logger with same name as returned by LoggerFactory
Throws:
java.io.ObjectStreamException
  protected Object readResolve() throws ObjectStreamException {
    Logger logger = LoggerFactory.getLogger(this.);
    return new SLF4JLocationAwareLog((LocationAwareLoggerlogger);
  }
New to GrepCode? Check out our FAQ X