org.jmonit.log.CommonsLoggingLogger Maven / Gradle / Ivy
Show all versions of jmonit Show documentation
/*
~ Copyright 2006-2007 Nicolas De Loof.
~
~ 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.jmonit.log;
import org.apache.commons.logging.LogFactory;
/**
* Logger
implementation based on jakarta commons-logging.
*
* Please notice commons-logging configuration is out of scope of jMonit runtime
* discovery. If you get troubles using commons-logging, read the doc at
* {http://jakarta.apache.org/commons/logging} and/or use the diagnostic mode of
* commons-logging 1.1 to check for classloaders conflicts.
*
* @author Nicolas De Loof
*/
public class CommonsLoggingLogger
extends Log
{
/** Commons-logging delegate */
private org.apache.commons.logging.Log log;
/**
* Constructor
*
* @param caller target logging class
*/
public CommonsLoggingLogger( Class caller )
{
super();
log = LogFactory.getLog( caller );
}
/**
* {@inheritDoc}
*
* @see info.jmonit.logger.Log#isDebugEnabled()
*/
public boolean isDebugEnabled()
{
return log.isDebugEnabled();
}
/**
* {@inheritDoc}
*
* @see info.jmonit.logger.Log#debug(java.lang.String)
*/
public void debug( String message )
{
log.debug( message );
}
/**
* {@inheritDoc}
*
* @see info.jmonit.logger.Log#info(java.lang.String)
*/
public void info( String message )
{
log.info( message );
}
/**
* {@inheritDoc}
*
* @see info.jmonit.logger.Log#info(java.lang.String, Throwable)
*/
public void info( String message, Throwable t )
{
log.info( message, t );
}
/**
* {@inheritDoc}
*
* @see info.jmonit.logger.Log#error(java.lang.String)
*/
public void error( String message )
{
log.error( message );
}
/**
* {@inheritDoc}
*
* @see info.jmonit.logger.Log#error(java.lang.String, Throwable)
*/
public void error( String message, Throwable t )
{
log.error( message, t );
}
/**
* {@inheritDoc}
*
* @see info.jmonit.logger.Log#warn(java.lang.String)
*/
public void warn( String message )
{
log.warn( message );
}
/**
* {@inheritDoc}
*
* @see info.jmonit.logger.Log#warn(java.lang.String, Throwable)
*/
public void warn( String message, Throwable t )
{
log.warn( message, t );
}
}