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 InvokerLogger
message
- The message to log, may be null
.public void debug(String message, Throwable throwable)
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)
info
in interface InvokerLogger
message
- The message to log, may be null
.public void info(String message, Throwable throwable)
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)
warn
in interface InvokerLogger
message
- The message to log, may be null
.public void warn(String message, Throwable throwable)
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)
error
in interface InvokerLogger
message
- The message to log, may be null
.public void error(String message, Throwable throwable)
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)
fatalError
in interface InvokerLogger
message
- The message to log, may be null
.public void fatalError(String message, Throwable throwable)
fatalError
in interface InvokerLogger
message
- The message to log, may be null
.throwable
- The exception to log, may be null
.public boolean isDebugEnabled()
isDebugEnabled.
isDebugEnabled
in interface InvokerLogger
public boolean isErrorEnabled()
isErrorEnabled.
isErrorEnabled
in interface InvokerLogger
public boolean isFatalErrorEnabled()
isFatalErrorEnabled.
isFatalErrorEnabled
in interface InvokerLogger
public boolean isInfoEnabled()
isInfoEnabled.
isInfoEnabled
in interface InvokerLogger
public boolean isWarnEnabled()
isWarnEnabled.
isWarnEnabled
in interface InvokerLogger
public int getThreshold()
Getter for the field threshold
.
getThreshold
in interface InvokerLogger
public void setThreshold(int threshold)
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–2022 The Apache Software Foundation. All rights reserved.