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 like System.out.
Since:
2.0.9
  • Constructor Details

    • PrintStreamLogger

      public PrintStreamLogger()
      Creates a new logger that writes to System.out and has a threshold of InvokerLogger.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 be null.
      threshold - The threshold for the logger.
  • Method Details

    • debug

      public void debug(String message)
      Logs the specified debug message.
      Specified by:
      debug in interface InvokerLogger
      Parameters:
      message - The message to log, may be null.
    • debug

      public void debug(String message, Throwable throwable)
      Logs the specified debug message and the accompanying exception.
      Specified by:
      debug in interface InvokerLogger
      Parameters:
      message - The message to log, may be null.
      throwable - The exception to log, may be null.
    • info

      public void info(String message)
      Logs the specified info message.
      Specified by:
      info in interface InvokerLogger
      Parameters:
      message - The message to log, may be null.
    • info

      public void info(String message, Throwable throwable)
      Logs the specified info message and the accompanying exception.
      Specified by:
      info in interface InvokerLogger
      Parameters:
      message - The message to log, may be null.
      throwable - The exception to log, may be null.
    • warn

      public void warn(String message)
      Logs the specified warning message.
      Specified by:
      warn in interface InvokerLogger
      Parameters:
      message - The message to log, may be null.
    • warn

      public void warn(String message, Throwable throwable)
      Logs the specified warning message and the accompanying exception.
      Specified by:
      warn in interface InvokerLogger
      Parameters:
      message - The message to log, may be null.
      throwable - The exception to log, may be null.
    • error

      public void error(String message)
      Logs the specified error message.
      Specified by:
      error in interface InvokerLogger
      Parameters:
      message - The message to log, may be null.
    • error

      public void error(String message, Throwable throwable)
      Logs the specified error message and the accompanying exception.
      Specified by:
      error in interface InvokerLogger
      Parameters:
      message - The message to log, may be null.
      throwable - The exception to log, may be null.
    • fatalError

      public void fatalError(String message)
      Logs the specified fatal error message.
      Specified by:
      fatalError in interface InvokerLogger
      Parameters:
      message - The message to log, may be null.
    • fatalError

      public void fatalError(String message, Throwable throwable)
      Logs the specified fatal error message and the accompanying exception.
      Specified by:
      fatalError in interface InvokerLogger
      Parameters:
      message - The message to log, may be null.
      throwable - The exception to log, may be null.
    • isDebugEnabled

      public boolean isDebugEnabled()

      isDebugEnabled.

      Specified by:
      isDebugEnabled in interface InvokerLogger
      Returns:
      a boolean.
    • isErrorEnabled

      public boolean isErrorEnabled()

      isErrorEnabled.

      Specified by:
      isErrorEnabled in interface InvokerLogger
      Returns:
      a boolean.
    • isFatalErrorEnabled

      public boolean isFatalErrorEnabled()

      isFatalErrorEnabled.

      Specified by:
      isFatalErrorEnabled in interface InvokerLogger
      Returns:
      a boolean.
    • isInfoEnabled

      public boolean isInfoEnabled()

      isInfoEnabled.

      Specified by:
      isInfoEnabled in interface InvokerLogger
      Returns:
      a boolean.
    • isWarnEnabled

      public boolean isWarnEnabled()

      isWarnEnabled.

      Specified by:
      isWarnEnabled in interface InvokerLogger
      Returns:
      a boolean.
    • getThreshold

      public int getThreshold()

      Getter for the field threshold.

      Specified by:
      getThreshold in interface InvokerLogger
      Returns:
      a int.
    • setThreshold

      public void setThreshold(int threshold)
      Sets the logger's threshold.
      Specified by:
      setThreshold in interface InvokerLogger
      Parameters:
      threshold - The logger's threshold, must be one of InvokerLogger.DEBUG, InvokerLogger.INFO, InvokerLogger.WARN, InvokerLogger.ERROR and InvokerLogger.FATAL.