Class LogRecorder

  • All Implemented Interfaces:
    Logger

    public class LogRecorder
    extends AbstractLogger
    Creates records of logged information.

    Clients may instantiate or subclass this class.

    • Constructor Detail

      • LogRecorder

        public LogRecorder()
    • Method Detail

      • getRecords

        public List<LogRecorder.Record> getRecords()
        Return the list of recorded logged information.
        Returns:
        an unmodifiable list of Record elements.
      • clear

        public void clear()
        Removes all records from this logger.
      • log

        protected void log​(Level level,
                           Object message,
                           Throwable error)
        Creates a record with the specified log information.
        Specified by:
        log in class AbstractLogger
        Parameters:
        level - the log level (known to be loggable).
        message - the information to log (usually a String), maybe null.
        error - an exception to log, maybe null.
      • recorded

        protected void recorded​(LogRecorder.Record record)
        Called when a record is created. This default implementation does nothing.
        Parameters:
        record - the created record