Class LogHandler


  • public class LogHandler
    extends Object
    Handles logging of issues log and error messages to a TaskListener instance.
    Author:
    Ullrich Hafner
    • Constructor Detail

      • LogHandler

        public LogHandler​(TaskListener listener,
                          String name)
        Creates a new LogHandler.
        Parameters:
        listener - the task listener that will print all log messages
        name - the name of the logger
      • LogHandler

        public LogHandler​(TaskListener listener,
                          String name,
                          edu.hm.hafner.util.FilteredLog logger)
        Creates a new LogHandler.
        Parameters:
        listener - the task listener that will print all log messages
        name - the name of the logger
        logger - the logger that contains the actual log messages
    • Method Detail

      • log

        public void log​(edu.hm.hafner.util.FilteredLog logger)
        Log all info and error messages that are stored in the set of issues. Note that subsequent calls to this method will only log messages that have not yet been logged.
        Parameters:
        logger - the logger with the collected messages
      • log

        @FormatMethod
        public void log​(String format,
                        Object... args)
        Logs the specified message.
        Parameters:
        format - A format string
        args - Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero.