Class AccumulatingLogger

java.lang.Object
org.apache.maven.api.cli.logging.AccumulatingLogger
All Implemented Interfaces:
Logger

public class AccumulatingLogger extends Object implements Logger
Early CLI Logger that simply accumulates log entries until some point a real logger can emit them. This logger is created at start, and it exists while no logging is available yet.
  • Constructor Details

    • AccumulatingLogger

      public AccumulatingLogger()
  • Method Details

    • log

      public void log(Logger.Level level, String message, Throwable error)
      Description copied from interface: Logger
      Logs a message at the specified level with an associated exception.
      Specified by:
      log in interface Logger
      Parameters:
      level - the severity level of the message
      message - the message to be logged
      error - the associated exception, or null if not applicable
    • drain

      public List<Logger.Entry> drain()
      Description copied from interface: Logger
      If this is an accumulating log, it will "drain" this instance. It returns the accumulated log entries, and also "resets" this instance to empty (initial) state.
      Specified by:
      drain in interface Logger