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
public class PrintStreamLogger extends Object implements InvokerLogger
Offers a logger that writes to a print stream likeSystem.out.- Since:
- 2.0.9
-
-
Constructor Summary
Constructors Constructor Description PrintStreamLogger()Creates 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebug(String message)Logs the specified debug message.voiddebug(String message, Throwable throwable)Logs the specified debug message and the accompanying exception.voiderror(String message)Logs the specified error message.voiderror(String message, Throwable throwable)Logs 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.intgetThreshold()Getter for the fieldthreshold.voidinfo(String message)Logs the specified info message.voidinfo(String message, Throwable throwable)Logs the specified info message and the accompanying exception.booleanisDebugEnabled()isDebugEnabled.booleanisErrorEnabled()isErrorEnabled.booleanisFatalErrorEnabled()isFatalErrorEnabled.booleanisInfoEnabled()isInfoEnabled.booleanisWarnEnabled()isWarnEnabled.voidsetThreshold(int threshold)Sets the logger's threshold.voidwarn(String message)Logs the specified warning message.voidwarn(String message, Throwable throwable)Logs the specified warning message and the accompanying exception.
-
-
-
Constructor Detail
-
PrintStreamLogger
public PrintStreamLogger()
Creates a new logger that writes toSystem.outand has a threshold ofInvokerLogger.INFO.
-
PrintStreamLogger
public PrintStreamLogger(PrintStream out, int threshold)
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 Detail
-
debug
public void debug(String message)
Logs the specified debug message.- Specified by:
debugin interfaceInvokerLogger- Parameters:
message- The message to log, may benull.
-
debug
public void debug(String message, Throwable throwable)
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
public void info(String message)
Logs the specified info message.- Specified by:
infoin interfaceInvokerLogger- Parameters:
message- The message to log, may benull.
-
info
public void info(String message, Throwable throwable)
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
public void warn(String message)
Logs the specified warning message.- Specified by:
warnin interfaceInvokerLogger- Parameters:
message- The message to log, may benull.
-
warn
public void warn(String message, Throwable throwable)
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
public void error(String message)
Logs the specified error message.- Specified by:
errorin interfaceInvokerLogger- Parameters:
message- The message to log, may benull.
-
error
public void error(String message, Throwable throwable)
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
public void fatalError(String message)
Logs the specified fatal error message.- Specified by:
fatalErrorin interfaceInvokerLogger- Parameters:
message- The message to log, may benull.
-
fatalError
public void fatalError(String message, Throwable throwable)
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.
-
-