Class WriterLog

  • All Implemented Interfaces:
    Log
    Direct Known Subclasses:
    StringBufferLog

    public class WriterLog
    extends Object
    implements Log
    A basic logger backed-up with Writer.
    Since:
    2.0
    Author:
    dvorak
    Interface is not intended to be extended by clients.
    This class is not intended to be subclassed by clients.
    • Constructor Detail

      • WriterLog

        public WriterLog​(Writer writer)
        Constructs a log for the given writer object.
        Parameters:
        writer - the writer object to receive the log record data
        Throws:
        IllegalArgumentException - if the passed writer is null
      • WriterLog

        public WriterLog​(Writer writer,
                         boolean flush)
        Constructs a log for the given writer object.
        Parameters:
        writer - the writer object to receive the log record data
        flush - if true, the writer gets flushed with every record logged. If set to false, the flushing behavior is dependent on the writer implementation used
        Throws:
        IllegalArgumentException - if the passed writer is null
        Since:
        3.0
    • Method Detail

      • log

        public void log​(int level,
                        String message,
                        Object param)
        Description copied from interface: Log
        Logs a message with additional parameter at the specified logging level.
        Specified by:
        log in interface Log
        Parameters:
        level - the level value to which the resulting log record should apply
        message - the textual message to be logged
        param - the parameter object to the message
      • log

        public void log​(int level,
                        String message)
        Description copied from interface: Log
        Logs a message at the specified logging level.
        Specified by:
        log in interface Log
        Parameters:
        level - the level value to which the resulting log record should apply
        message - the textual message to be logged
      • log

        public void log​(String message,
                        Object param)
        Description copied from interface: Log
        Logs a message with additional parameter.
        Specified by:
        log in interface Log
        Parameters:
        message - the textual message to be logged
        param - the parameter object to the message
      • log

        public void log​(String message)
        Description copied from interface: Log
        Logs a message.
        Specified by:
        log in interface Log
        Parameters:
        message - the textual message to be logged