org.apache.openjpa.lib.log
Class LogFactoryImpl.LogImpl

java.lang.Object
  extended by org.apache.openjpa.lib.log.AbstractLog
      extended by org.apache.openjpa.lib.log.LogFactoryImpl.LogImpl
All Implemented Interfaces:
Log
Enclosing class:
LogFactoryImpl

public class LogFactoryImpl.LogImpl
extends AbstractLog

A simple implementation of the Log interface. Writes output to stderr.


Field Summary
 
Fields inherited from interface org.apache.openjpa.lib.log.Log
ERROR, FATAL, INFO, TRACE, WARN
 
Constructor Summary
LogFactoryImpl.LogImpl()
           
 
Method Summary
protected  String formatMessage(short level, String message, Throwable t)
          Convert message into a string ready to be written to the log.
 String getChannel()
           
 short getLevel()
           
protected  boolean isEnabled(short level)
          Check to see if the specified logging level is enabled.
protected  void log(short level, String message, Throwable t)
          Send the specified log message to the handler.
 void setChannel(String val)
           
 void setLevel(short val)
           
 
Methods inherited from class org.apache.openjpa.lib.log.AbstractLog
error, error, fatal, fatal, getStackTrace, info, info, isErrorEnabled, isFatalEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, trace, trace, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogFactoryImpl.LogImpl

public LogFactoryImpl.LogImpl()
Method Detail

isEnabled

protected boolean isEnabled(short level)
Description copied from class: AbstractLog
Check to see if the specified logging level is enabled.

Specified by:
isEnabled in class AbstractLog

log

protected void log(short level,
                   String message,
                   Throwable t)
Description copied from class: AbstractLog
Send the specified log message to the handler.

Specified by:
log in class AbstractLog
Parameters:
level - the level of the log message
message - the message to send
t - the Throwable, or null if this is not an error

formatMessage

protected String formatMessage(short level,
                               String message,
                               Throwable t)
Convert message into a string ready to be written to the log. The string should include the terminating newline.

Parameters:
t - may be null

setChannel

public void setChannel(String val)

getChannel

public String getChannel()

setLevel

public void setLevel(short val)

getLevel

public short getLevel()


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.