public abstract class AbstractLog extends Object implements Log
Log interface. Writes
output to stdout.| Constructor and Description |
|---|
AbstractLog() |
| Modifier and Type | Method and Description |
|---|---|
void |
error(Object message)
Write out a log message at the
Log.ERROR
level with the stringification of o as the body
of the message, also outputting t to the log. |
void |
error(Object message,
Throwable t)
Write out a log message at the
Log.ERROR
level with the stringification of o as the body
of the message, also outputting t to the log. |
void |
fatal(Object message)
Write out a log message at the
Log.FATAL
level with the stringification of o as the body
of the message, also outputting t to the log. |
void |
fatal(Object message,
Throwable t)
Write out a log message at the
Log.FATAL
level with the stringification of o as the body
of the message, also outputting t to the log. |
protected static String |
getStackTrace(Throwable t)
Utility method to obtain a stack trace as a String.
|
void |
info(Object message)
Write out a log message at the
Log.INFO
level with the stringification of o as the body
of the message, also outputting t to the log. |
void |
info(Object message,
Throwable t)
Write out a log message at the
Log.INFO
level with the stringification of o as the body
of the message, also outputting t to the log. |
protected abstract boolean |
isEnabled(short level)
Check to see if the specified logging level is enabled.
|
boolean |
isErrorEnabled()
Returns if the
Log.ERROR log level is enabled. |
boolean |
isFatalEnabled()
Returns if the
Log.FATAL log level is enabled. |
boolean |
isInfoEnabled()
Returns if the
Log.INFO log level is enabled. |
boolean |
isTraceEnabled()
Returns if the
Log.TRACE log level is enabled. |
boolean |
isWarnEnabled()
Returns if the
Log.WARN log level is enabled. |
protected abstract void |
log(short level,
String message,
Throwable t)
Send the specified log message to the handler.
|
void |
trace(Object message)
Write out a log message at the
Log.TRACE
level with the stringification of o as the body
of the message. |
void |
trace(Object message,
Throwable t)
Write out a log message at the
Log.TRACE
level with the stringification of o as the body
of the message, also outputting t to the log. |
void |
warn(Object message)
Write out a log message at the
Log.WARN
level with the stringification of o as the body
of the message, also outputting t to the log. |
void |
warn(Object message,
Throwable t)
Write out a log message at the
Log.WARN
level with the stringification of o as the body
of the message, also outputting t to the log. |
protected abstract boolean isEnabled(short level)
protected abstract void log(short level,
String message,
Throwable t)
level - the level of the log messagemessage - the message to sendt - the Throwable, or null if this is not an errorpublic boolean isTraceEnabled()
LogLog.TRACE log level is enabled.isTraceEnabled in interface Logpublic boolean isInfoEnabled()
LogLog.INFO log level is enabled.isInfoEnabled in interface Logpublic boolean isWarnEnabled()
LogLog.WARN log level is enabled.isWarnEnabled in interface Logpublic boolean isErrorEnabled()
LogLog.ERROR log level is enabled.isErrorEnabled in interface Logpublic boolean isFatalEnabled()
LogLog.FATAL log level is enabled.isFatalEnabled in interface Logpublic void trace(Object message)
LogLog.TRACE
level with the stringification of o as the body
of the message.public void trace(Object message, Throwable t)
LogLog.TRACE
level with the stringification of o as the body
of the message, also outputting t to the log.public void info(Object message)
LogLog.INFO
level with the stringification of o as the body
of the message, also outputting t to the log.public void info(Object message, Throwable t)
LogLog.INFO
level with the stringification of o as the body
of the message, also outputting t to the log.public void warn(Object message)
LogLog.WARN
level with the stringification of o as the body
of the message, also outputting t to the log.public void warn(Object message, Throwable t)
LogLog.WARN
level with the stringification of o as the body
of the message, also outputting t to the log.public void error(Object message)
LogLog.ERROR
level with the stringification of o as the body
of the message, also outputting t to the log.public void error(Object message, Throwable t)
LogLog.ERROR
level with the stringification of o as the body
of the message, also outputting t to the log.public void fatal(Object message)
LogLog.FATAL
level with the stringification of o as the body
of the message, also outputting t to the log.public void fatal(Object message, Throwable t)
LogLog.FATAL
level with the stringification of o as the body
of the message, also outputting t to the log.Copyright © 2006–2022 Apache Software Foundation. All rights reserved.