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)
InvokerLogger
debug
in interface InvokerLogger
message
- The message to log, may be null
.public void debug(String message, Throwable throwable)
InvokerLogger
debug
in interface InvokerLogger
message
- The message to log, may be null
.throwable
- The exception to log, may be null
.public void info(String message)
InvokerLogger
info
in interface InvokerLogger
message
- The message to log, may be null
.public void info(String message, Throwable throwable)
InvokerLogger
info
in interface InvokerLogger
message
- The message to log, may be null
.throwable
- The exception to log, may be null
.public void warn(String message)
InvokerLogger
warn
in interface InvokerLogger
message
- The message to log, may be null
.public void warn(String message, Throwable throwable)
InvokerLogger
warn
in interface InvokerLogger
message
- The message to log, may be null
.throwable
- The exception to log, may be null
.public void error(String message)
InvokerLogger
error
in interface InvokerLogger
message
- The message to log, may be null
.public void error(String message, Throwable throwable)
InvokerLogger
error
in interface InvokerLogger
message
- The message to log, may be null
.throwable
- The exception to log, may be null
.public void fatalError(String message)
InvokerLogger
fatalError
in interface InvokerLogger
message
- The message to log, may be null
.public void fatalError(String message, Throwable throwable)
InvokerLogger
fatalError
in interface InvokerLogger
message
- The message to log, may be null
.throwable
- The exception to log, may be null
.public boolean isDebugEnabled()
InvokerLogger
isDebugEnabled
in interface InvokerLogger
true
if messages with priority "debug" or above are logged, false
otherwise.public boolean isErrorEnabled()
InvokerLogger
isErrorEnabled
in interface InvokerLogger
true
if messages with priority "error" or above are logged, false
otherwise.public boolean isFatalErrorEnabled()
InvokerLogger
isFatalErrorEnabled
in interface InvokerLogger
true
if messages with priority "fatal" or above are logged, false
otherwise.public boolean isInfoEnabled()
InvokerLogger
isInfoEnabled
in interface InvokerLogger
true
if messages with priority "info" or above are logged, false
otherwise.public boolean isWarnEnabled()
InvokerLogger
isWarnEnabled
in interface InvokerLogger
true
if messages with priority "warn" or above are logged, false
otherwise.public int getThreshold()
InvokerLogger
getThreshold
in interface InvokerLogger
InvokerLogger.DEBUG
, InvokerLogger.INFO
, InvokerLogger.WARN
, InvokerLogger.ERROR
and
InvokerLogger.FATAL
.public void setThreshold(int threshold)
InvokerLogger
setThreshold
in interface InvokerLogger
threshold
- The logger's threshold, must be one of InvokerLogger.DEBUG
, InvokerLogger.INFO
, InvokerLogger.WARN
,
InvokerLogger.ERROR
and InvokerLogger.FATAL
.Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.