public class PrintStreamLogger extends Object implements InvokerLogger
System.out.| Constructor and Description |
|---|
PrintStreamLogger()
Creates a new logger that writes to
System.out and has a threshold of InvokerLogger.INFO. |
PrintStreamLogger(PrintStream out,
int threshold)
Creates a new logger that writes to the specified print stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
debug(String message)
Logs the specified debug message.
|
void |
debug(String message,
Throwable throwable)
Logs the specified debug message and the accompanying exception.
|
void |
error(String message)
Logs the specified error message.
|
void |
error(String message,
Throwable throwable)
Logs the specified error message and the accompanying exception.
|
void |
fatalError(String message)
Logs the specified fatal error message.
|
void |
fatalError(String message,
Throwable throwable)
Logs the specified fatal error message and the accompanying exception.
|
int |
getThreshold()
Gets the logger's threshold.
|
void |
info(String message)
Logs the specified info message.
|
void |
info(String message,
Throwable throwable)
Logs the specified info message and the accompanying exception.
|
boolean |
isDebugEnabled()
Tests whether debug output is enabled for this logger.
|
boolean |
isErrorEnabled()
Tests whether error output is enabled for this logger.
|
boolean |
isFatalErrorEnabled()
Tests whether fatal error output is enabled for this logger.
|
boolean |
isInfoEnabled()
Tests whether info output is enabled for this logger.
|
boolean |
isWarnEnabled()
Tests whether warn output is enabled for this logger.
|
void |
setThreshold(int threshold)
Sets the logger's threshold.
|
void |
warn(String message)
Logs the specified warning message.
|
void |
warn(String message,
Throwable throwable)
Logs the specified warning message and the accompanying exception.
|
public PrintStreamLogger()
System.out and has a threshold of InvokerLogger.INFO.public PrintStreamLogger(PrintStream out, int threshold)
out - The print stream to write to, must not be null.threshold - The threshold for the logger.public void debug(String message)
InvokerLoggerdebug in interface InvokerLoggermessage - The message to log, may be null.public void debug(String message, Throwable throwable)
InvokerLoggerdebug in interface InvokerLoggermessage - The message to log, may be null.throwable - The exception to log, may be null.public void info(String message)
InvokerLoggerinfo in interface InvokerLoggermessage - The message to log, may be null.public void info(String message, Throwable throwable)
InvokerLoggerinfo in interface InvokerLoggermessage - The message to log, may be null.throwable - The exception to log, may be null.public void warn(String message)
InvokerLoggerwarn in interface InvokerLoggermessage - The message to log, may be null.public void warn(String message, Throwable throwable)
InvokerLoggerwarn in interface InvokerLoggermessage - The message to log, may be null.throwable - The exception to log, may be null.public void error(String message)
InvokerLoggererror in interface InvokerLoggermessage - The message to log, may be null.public void error(String message, Throwable throwable)
InvokerLoggererror in interface InvokerLoggermessage - The message to log, may be null.throwable - The exception to log, may be null.public void fatalError(String message)
InvokerLoggerfatalError in interface InvokerLoggermessage - The message to log, may be null.public void fatalError(String message, Throwable throwable)
InvokerLoggerfatalError in interface InvokerLoggermessage - The message to log, may be null.throwable - The exception to log, may be null.public boolean isDebugEnabled()
InvokerLoggerisDebugEnabled in interface InvokerLoggertrue if messages with priority "debug" or above are logged, false
otherwise.public boolean isErrorEnabled()
InvokerLoggerisErrorEnabled in interface InvokerLoggertrue if messages with priority "error" or above are logged, false
otherwise.public boolean isFatalErrorEnabled()
InvokerLoggerisFatalErrorEnabled in interface InvokerLoggertrue if messages with priority "fatal" or above are logged, false
otherwise.public boolean isInfoEnabled()
InvokerLoggerisInfoEnabled in interface InvokerLoggertrue if messages with priority "info" or above are logged, false otherwise.public boolean isWarnEnabled()
InvokerLoggerisWarnEnabled in interface InvokerLoggertrue if messages with priority "warn" or above are logged, false otherwise.public int getThreshold()
InvokerLoggergetThreshold in interface InvokerLoggerInvokerLogger.DEBUG, InvokerLogger.INFO, InvokerLogger.WARN, InvokerLogger.ERROR and
InvokerLogger.FATAL.public void setThreshold(int threshold)
InvokerLoggersetThreshold in interface InvokerLoggerthreshold - The logger's threshold, must be one of InvokerLogger.DEBUG, InvokerLogger.INFO, InvokerLogger.WARN,
InvokerLogger.ERROR and InvokerLogger.FATAL.Copyright © 2002–2015 The Apache Software Foundation. All rights reserved.