Class DefaultLog

java.lang.Object
org.apache.rat.utils.DefaultLog
All Implemented Interfaces:
Log

public final class DefaultLog extends Object implements Log
A default implementation of Log that writes to System.out and System.err
  • Field Details

    • ENV_VAR

      public static final String ENV_VAR
      The environment variable to set the default log level that Rat should log at. If not specified INFO is used.
      See Also:
  • Method Details

    • getInstance

      public static Log getInstance()
      Retrieves teh DefaultLog instance.
      Returns:
      the Default log instance.
    • setInstance

      public static Log setInstance(Log newInstance)
      Sets the default log instance. If not set an instance of DefaultLog will be returned
      Parameters:
      newInstance - a Log to use as the default.
      Returns:
      the old instance.
    • setLevel

      public void setLevel(Log.Level level)
      Sets the level. Log messages below the specified level will not be written to the log.
      Specified by:
      setLevel in interface Log
      Parameters:
      level - the level to use when writing messages.
    • getLevel

      public Log.Level getLevel()
      Gets the level we are writing at.
      Specified by:
      getLevel in interface Log
      Returns:
      the level we are writing at.
    • 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.