Class TestingLog

java.lang.Object
org.apache.rat.testhelpers.TestingLog
All Implemented Interfaces:
Log

public class TestingLog extends Object implements Log
Log that captures output for later review.
  • Constructor Details

    • TestingLog

      public TestingLog()
  • Method Details

    • clear

      public void clear()
      Clears the captured buffer.
    • getCaptured

      public String getCaptured()
      Gets the captured log entries.
      Returns:
      the log entries.
    • getLevel

      public Log.Level getLevel()
      Description copied from interface: Log
      Gets the log level that is enabled. If encapsulated logger does not report level implementations should return DEBUG.
      Specified by:
      getLevel in interface Log
      Returns:
      the level that is enabled.
    • setLevel

      public void setLevel(Log.Level level)
      Description copied from interface: Log
      Sets the log level. Implementations may elect not to set the level dynamically. However, if the option is supported this method should be overridden.
      Specified by:
      setLevel in interface Log
      Parameters:
      level - the level to set.
    • log

      public void log(Log.Level level, String msg)
      Description copied from interface: Log
      Writes a message at a specific log level.
      Specified by:
      log in interface Log
      Parameters:
      level - The log level to write at.
      msg - the message to write.
    • isEmpty

      public boolean isEmpty()
      Determines if the log is empty.
      Returns:
      true if the log is empty.