Class SystemStreamLogger

  • All Implemented Interfaces:
    Logger

    public class SystemStreamLogger
    extends AbstractLogger
    implements Logger
    Logger implementation which outputs log messages to System.out and System.err streams.

    Debug and info messages are logged to System.out. Warnings and errors are logged to System.err.

    Clients may instantiate or subclass this class.

    • Constructor Detail

      • SystemStreamLogger

        public SystemStreamLogger()
    • Method Detail

      • log

        protected void log​(Level level,
                           Object message,
                           Throwable error)
        Logs the specified message and error to System.out or System.err.

        Debug and info messages are logged to System.out. Warnings and errors are logged to System.err.

        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.