Package org.apache.openjpa.lib.log
Class AbstractLog
- java.lang.Object
-
- org.apache.openjpa.lib.log.AbstractLog
-
- All Implemented Interfaces:
Log
- Direct Known Subclasses:
LogFactoryImpl.LogImpl
public abstract class AbstractLog extends java.lang.Object implements Log
A simple implementation of theLoginterface. Writes output to stdout.- Author:
- Patrick Linskey
-
-
Constructor Summary
Constructors Constructor Description AbstractLog()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiderror(java.lang.Object message)Write out a log message at theLog.ERRORlevel with the stringification ofoas the body of the message, also outputtingtto the log.voiderror(java.lang.Object message, java.lang.Throwable t)Write out a log message at theLog.ERRORlevel with the stringification ofoas the body of the message, also outputtingtto the log.voidfatal(java.lang.Object message)Write out a log message at theLog.FATALlevel with the stringification ofoas the body of the message, also outputtingtto the log.voidfatal(java.lang.Object message, java.lang.Throwable t)Write out a log message at theLog.FATALlevel with the stringification ofoas the body of the message, also outputtingtto the log.protected static java.lang.StringgetStackTrace(java.lang.Throwable t)Utility method to obtain a stack trace as a String.voidinfo(java.lang.Object message)Write out a log message at theLog.INFOlevel with the stringification ofoas the body of the message, also outputtingtto the log.voidinfo(java.lang.Object message, java.lang.Throwable t)Write out a log message at theLog.INFOlevel with the stringification ofoas the body of the message, also outputtingtto the log.protected abstract booleanisEnabled(short level)Check to see if the specified logging level is enabled.booleanisErrorEnabled()Returns if theLog.ERRORlog level is enabled.booleanisFatalEnabled()Returns if theLog.FATALlog level is enabled.booleanisInfoEnabled()Returns if theLog.INFOlog level is enabled.booleanisTraceEnabled()Returns if theLog.TRACElog level is enabled.booleanisWarnEnabled()Returns if theLog.WARNlog level is enabled.protected abstract voidlog(short level, java.lang.String message, java.lang.Throwable t)Send the specified log message to the handler.voidtrace(java.lang.Object message)Write out a log message at theLog.TRACElevel with the stringification ofoas the body of the message.voidtrace(java.lang.Object message, java.lang.Throwable t)Write out a log message at theLog.TRACElevel with the stringification ofoas the body of the message, also outputtingtto the log.voidwarn(java.lang.Object message)Write out a log message at theLog.WARNlevel with the stringification ofoas the body of the message, also outputtingtto the log.voidwarn(java.lang.Object message, java.lang.Throwable t)Write out a log message at theLog.WARNlevel with the stringification ofoas the body of the message, also outputtingtto the log.
-
-
-
Method Detail
-
isEnabled
protected abstract boolean isEnabled(short level)
Check to see if the specified logging level is enabled.
-
log
protected abstract void log(short level, java.lang.String message, java.lang.Throwable t)Send the specified log message to the handler.- Parameters:
level- the level of the log messagemessage- the message to sendt- the Throwable, or null if this is not an error
-
isTraceEnabled
public boolean isTraceEnabled()
Description copied from interface:LogReturns if theLog.TRACElog level is enabled.- Specified by:
isTraceEnabledin interfaceLog
-
isInfoEnabled
public boolean isInfoEnabled()
Description copied from interface:LogReturns if theLog.INFOlog level is enabled.- Specified by:
isInfoEnabledin interfaceLog
-
isWarnEnabled
public boolean isWarnEnabled()
Description copied from interface:LogReturns if theLog.WARNlog level is enabled.- Specified by:
isWarnEnabledin interfaceLog
-
isErrorEnabled
public boolean isErrorEnabled()
Description copied from interface:LogReturns if theLog.ERRORlog level is enabled.- Specified by:
isErrorEnabledin interfaceLog
-
isFatalEnabled
public boolean isFatalEnabled()
Description copied from interface:LogReturns if theLog.FATALlog level is enabled.- Specified by:
isFatalEnabledin interfaceLog
-
trace
public void trace(java.lang.Object message)
Description copied from interface:LogWrite out a log message at theLog.TRACElevel with the stringification ofoas the body of the message.
-
trace
public void trace(java.lang.Object message, java.lang.Throwable t)Description copied from interface:LogWrite out a log message at theLog.TRACElevel with the stringification ofoas the body of the message, also outputtingtto the log.
-
info
public void info(java.lang.Object message)
Description copied from interface:LogWrite out a log message at theLog.INFOlevel with the stringification ofoas the body of the message, also outputtingtto the log.
-
info
public void info(java.lang.Object message, java.lang.Throwable t)Description copied from interface:LogWrite out a log message at theLog.INFOlevel with the stringification ofoas the body of the message, also outputtingtto the log.
-
warn
public void warn(java.lang.Object message)
Description copied from interface:LogWrite out a log message at theLog.WARNlevel with the stringification ofoas the body of the message, also outputtingtto the log.
-
warn
public void warn(java.lang.Object message, java.lang.Throwable t)Description copied from interface:LogWrite out a log message at theLog.WARNlevel with the stringification ofoas the body of the message, also outputtingtto the log.
-
error
public void error(java.lang.Object message)
Description copied from interface:LogWrite out a log message at theLog.ERRORlevel with the stringification ofoas the body of the message, also outputtingtto the log.
-
error
public void error(java.lang.Object message, java.lang.Throwable t)Description copied from interface:LogWrite out a log message at theLog.ERRORlevel with the stringification ofoas the body of the message, also outputtingtto the log.
-
fatal
public void fatal(java.lang.Object message)
Description copied from interface:LogWrite out a log message at theLog.FATALlevel with the stringification ofoas the body of the message, also outputtingtto the log.
-
fatal
public void fatal(java.lang.Object message, java.lang.Throwable t)Description copied from interface:LogWrite out a log message at theLog.FATALlevel with the stringification ofoas the body of the message, also outputtingtto the log.
-
getStackTrace
protected static java.lang.String getStackTrace(java.lang.Throwable t)
Utility method to obtain a stack trace as a String.
-
-