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()
Getter for the field
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()
isDebugEnabled.
|
boolean |
isErrorEnabled()
isErrorEnabled.
|
boolean |
isFatalErrorEnabled()
isFatalErrorEnabled.
|
boolean |
isInfoEnabled()
isInfoEnabled.
|
boolean |
isWarnEnabled()
isWarnEnabled.
|
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)
debug in interface InvokerLoggermessage - The message to log, may be null.public void debug(String message, Throwable throwable)
debug in interface InvokerLoggermessage - The message to log, may be null.throwable - The exception to log, may be null.public void info(String message)
info in interface InvokerLoggermessage - The message to log, may be null.public void info(String message, Throwable throwable)
info in interface InvokerLoggermessage - The message to log, may be null.throwable - The exception to log, may be null.public void warn(String message)
warn in interface InvokerLoggermessage - The message to log, may be null.public void warn(String message, Throwable throwable)
warn in interface InvokerLoggermessage - The message to log, may be null.throwable - The exception to log, may be null.public void error(String message)
error in interface InvokerLoggermessage - The message to log, may be null.public void error(String message, Throwable throwable)
error in interface InvokerLoggermessage - The message to log, may be null.throwable - The exception to log, may be null.public void fatalError(String message)
fatalError in interface InvokerLoggermessage - The message to log, may be null.public void fatalError(String message, Throwable throwable)
fatalError in interface InvokerLoggermessage - The message to log, may be null.throwable - The exception to log, may be null.public boolean isDebugEnabled()
isDebugEnabled.
isDebugEnabled in interface InvokerLoggerpublic boolean isErrorEnabled()
isErrorEnabled.
isErrorEnabled in interface InvokerLoggerpublic boolean isFatalErrorEnabled()
isFatalErrorEnabled.
isFatalErrorEnabled in interface InvokerLoggerpublic boolean isInfoEnabled()
isInfoEnabled.
isInfoEnabled in interface InvokerLoggerpublic boolean isWarnEnabled()
isWarnEnabled.
isWarnEnabled in interface InvokerLoggerpublic int getThreshold()
Getter for the field threshold.
getThreshold in interface InvokerLoggerpublic void setThreshold(int threshold)
setThreshold in interface InvokerLoggerthreshold - The logger's threshold, must be one of InvokerLogger.DEBUG, InvokerLogger.INFO, InvokerLogger.WARN,
InvokerLogger.ERROR and InvokerLogger.FATAL.Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.