Package org.apache.maven.shared.invoker
Class PrintStreamLogger
java.lang.Object
org.apache.maven.shared.invoker.PrintStreamLogger
- All Implemented Interfaces:
InvokerLogger
- Direct Known Subclasses:
SystemOutLogger
Offers a logger that writes to a print stream like
System.out
.- Since:
- 2.0.9
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates a new logger that writes toSystem.out
and has a threshold ofInvokerLogger.INFO
.PrintStreamLogger
(PrintStream out, int threshold) Creates a new logger that writes to the specified print stream. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Logs the specified debug message.void
Logs the specified debug message and the accompanying exception.void
Logs the specified error message.void
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
Getter for the fieldthreshold
.void
Logs the specified info message.void
Logs the specified info message and the accompanying exception.boolean
isDebugEnabled.boolean
isErrorEnabled.boolean
isFatalErrorEnabled.boolean
isInfoEnabled.boolean
isWarnEnabled.void
setThreshold
(int threshold) Sets the logger's threshold.void
Logs the specified warning message.void
Logs the specified warning message and the accompanying exception.
-
Constructor Details
-
PrintStreamLogger
public PrintStreamLogger()Creates a new logger that writes toSystem.out
and has a threshold ofInvokerLogger.INFO
. -
PrintStreamLogger
Creates a new logger that writes to the specified print stream.- Parameters:
out
- The print stream to write to, must not benull
.threshold
- The threshold for the logger.
-
-
Method Details
-
debug
Logs the specified debug message.- Specified by:
debug
in interfaceInvokerLogger
- Parameters:
message
- The message to log, may benull
.
-
debug
Logs the specified debug message and the accompanying exception.- Specified by:
debug
in interfaceInvokerLogger
- Parameters:
message
- The message to log, may benull
.throwable
- The exception to log, may benull
.
-
info
Logs the specified info message.- Specified by:
info
in interfaceInvokerLogger
- Parameters:
message
- The message to log, may benull
.
-
info
Logs the specified info message and the accompanying exception.- Specified by:
info
in interfaceInvokerLogger
- Parameters:
message
- The message to log, may benull
.throwable
- The exception to log, may benull
.
-
warn
Logs the specified warning message.- Specified by:
warn
in interfaceInvokerLogger
- Parameters:
message
- The message to log, may benull
.
-
warn
Logs the specified warning message and the accompanying exception.- Specified by:
warn
in interfaceInvokerLogger
- Parameters:
message
- The message to log, may benull
.throwable
- The exception to log, may benull
.
-
error
Logs the specified error message.- Specified by:
error
in interfaceInvokerLogger
- Parameters:
message
- The message to log, may benull
.
-
error
Logs the specified error message and the accompanying exception.- Specified by:
error
in interfaceInvokerLogger
- Parameters:
message
- The message to log, may benull
.throwable
- The exception to log, may benull
.
-
fatalError
Logs the specified fatal error message.- Specified by:
fatalError
in interfaceInvokerLogger
- Parameters:
message
- The message to log, may benull
.
-
fatalError
Logs the specified fatal error message and the accompanying exception.- Specified by:
fatalError
in interfaceInvokerLogger
- Parameters:
message
- The message to log, may benull
.throwable
- The exception to log, may benull
.
-
isDebugEnabled
public boolean isDebugEnabled()isDebugEnabled.
- Specified by:
isDebugEnabled
in interfaceInvokerLogger
- Returns:
- a boolean.
-
isErrorEnabled
public boolean isErrorEnabled()isErrorEnabled.
- Specified by:
isErrorEnabled
in interfaceInvokerLogger
- Returns:
- a boolean.
-
isFatalErrorEnabled
public boolean isFatalErrorEnabled()isFatalErrorEnabled.
- Specified by:
isFatalErrorEnabled
in interfaceInvokerLogger
- Returns:
- a boolean.
-
isInfoEnabled
public boolean isInfoEnabled()isInfoEnabled.
- Specified by:
isInfoEnabled
in interfaceInvokerLogger
- Returns:
- a boolean.
-
isWarnEnabled
public boolean isWarnEnabled()isWarnEnabled.
- Specified by:
isWarnEnabled
in interfaceInvokerLogger
- Returns:
- a boolean.
-
getThreshold
public int getThreshold()Getter for the field
threshold
.- Specified by:
getThreshold
in interfaceInvokerLogger
- Returns:
- a int.
-
setThreshold
public void setThreshold(int threshold) Sets the logger's threshold.- Specified by:
setThreshold
in interfaceInvokerLogger
- Parameters:
threshold
- The logger's threshold, must be one ofInvokerLogger.DEBUG
,InvokerLogger.INFO
,InvokerLogger.WARN
,InvokerLogger.ERROR
andInvokerLogger.FATAL
.
-