Class DefaultLogDelegate

  • All Implemented Interfaces:
    LogDelegate

    public class DefaultLogDelegate
    extends AbstractLogDelegate
    This class writes log messages to standard output or standard error. Messages with log level WARN or higher will be written to standard error. Other messages will be written to standard output.

    For more information see Logger and AbstractLogDelegate.

    • Constructor Detail

      • DefaultLogDelegate

        public DefaultLogDelegate()
    • Method Detail

      • printTaggedMessage

        public int printTaggedMessage​(int priority,
                                      String tag,
                                      String msg)
        Description copied from class: AbstractLogDelegate
        Writes a log message. Every line in the message text has already been tagged with the log level, message tag (identifier of the source of the log message) and the current date and time. Every line ends with a new line character, including the last line.

        This method is only called if isLoggable() returns true. It's called inside a lock, so it's thread safe.

        For returned error codes, a subclass may define its own error codes based on ERROR_BASE.

        Specified by:
        printTaggedMessage in class AbstractLogDelegate
        Parameters:
        priority - the log level
        tag - the message tag
        msg - the tagged message
        Returns:
        0 if no error occurred, an error code otherwise.