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
ConstructorsConstructorDescriptionCreates a new logger that writes toSystem.outand 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 TypeMethodDescriptionvoidLogs the specified debug message.voidLogs the specified debug message and the accompanying exception.voidLogs the specified error message.voidLogs the specified error message and the accompanying exception.voidfatalError(String message) Logs the specified fatal error message.voidfatalError(String message, Throwable throwable) Logs the specified fatal error message and the accompanying exception.intGetter for the fieldthreshold.voidLogs the specified info message.voidLogs the specified info message and the accompanying exception.booleanisDebugEnabled.booleanisErrorEnabled.booleanisFatalErrorEnabled.booleanisInfoEnabled.booleanisWarnEnabled.voidsetThreshold(int threshold) Sets the logger's threshold.voidLogs the specified warning message.voidLogs the specified warning message and the accompanying exception.
-
Constructor Details
-
PrintStreamLogger
public PrintStreamLogger()Creates a new logger that writes toSystem.outand 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:
debugin interfaceInvokerLogger- Parameters:
message- The message to log, may benull.
-
debug
Logs the specified debug message and the accompanying exception.- Specified by:
debugin interfaceInvokerLogger- Parameters:
message- The message to log, may benull.throwable- The exception to log, may benull.
-
info
Logs the specified info message.- Specified by:
infoin interfaceInvokerLogger- Parameters:
message- The message to log, may benull.
-
info
Logs the specified info message and the accompanying exception.- Specified by:
infoin interfaceInvokerLogger- Parameters:
message- The message to log, may benull.throwable- The exception to log, may benull.
-
warn
Logs the specified warning message.- Specified by:
warnin interfaceInvokerLogger- Parameters:
message- The message to log, may benull.
-
warn
Logs the specified warning message and the accompanying exception.- Specified by:
warnin interfaceInvokerLogger- Parameters:
message- The message to log, may benull.throwable- The exception to log, may benull.
-
error
Logs the specified error message.- Specified by:
errorin interfaceInvokerLogger- Parameters:
message- The message to log, may benull.
-
error
Logs the specified error message and the accompanying exception.- Specified by:
errorin 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:
fatalErrorin interfaceInvokerLogger- Parameters:
message- The message to log, may benull.
-
fatalError
Logs the specified fatal error message and the accompanying exception.- Specified by:
fatalErrorin interfaceInvokerLogger- Parameters:
message- The message to log, may benull.throwable- The exception to log, may benull.
-
isDebugEnabled
public boolean isDebugEnabled()isDebugEnabled.
- Specified by:
isDebugEnabledin interfaceInvokerLogger- Returns:
- a boolean.
-
isErrorEnabled
public boolean isErrorEnabled()isErrorEnabled.
- Specified by:
isErrorEnabledin interfaceInvokerLogger- Returns:
- a boolean.
-
isFatalErrorEnabled
public boolean isFatalErrorEnabled()isFatalErrorEnabled.
- Specified by:
isFatalErrorEnabledin interfaceInvokerLogger- Returns:
- a boolean.
-
isInfoEnabled
public boolean isInfoEnabled()isInfoEnabled.
- Specified by:
isInfoEnabledin interfaceInvokerLogger- Returns:
- a boolean.
-
isWarnEnabled
public boolean isWarnEnabled()isWarnEnabled.
- Specified by:
isWarnEnabledin interfaceInvokerLogger- Returns:
- a boolean.
-
getThreshold
public int getThreshold()Getter for the field
threshold.- Specified by:
getThresholdin interfaceInvokerLogger- Returns:
- a int.
-
setThreshold
public void setThreshold(int threshold) Sets the logger's threshold.- Specified by:
setThresholdin interfaceInvokerLogger- Parameters:
threshold- The logger's threshold, must be one ofInvokerLogger.DEBUG,InvokerLogger.INFO,InvokerLogger.WARN,InvokerLogger.ERRORandInvokerLogger.FATAL.
-