Package org.slf4j.spi

Interface LoggingEventBuilder

    • Method Detail

      • addArgument

        @CheckReturnValue
        LoggingEventBuilder addArgument​(java.util.function.Supplier<?> objectSupplier)
        Add an argument supplier to the event being built.
        Parameters:
        objectSupplier - an Object supplier to add.
        Returns:
        a LoggingEventBuilder, usually this.
      • addKeyValue

        @CheckReturnValue
        LoggingEventBuilder addKeyValue​(java.lang.String key,
                                        java.util.function.Supplier<java.lang.Object> valueSupplier)
        Add a key value pair to the event being built.
        Parameters:
        key - the key of the key value pair.
        valueSupplier - a supplier of a value for the key value pair.
        Returns:
        a LoggingEventBuilder, usually this.
      • setMessage

        @CheckReturnValue
        LoggingEventBuilder setMessage​(java.util.function.Supplier<java.lang.String> messageSupplier)
        Sets the message of the event via a message supplier.
        Parameters:
        messageSupplier - supplies a String to be used as the message for the event
        Since:
        2.0.0-beta0
      • log

        void log()
        After the logging event is built, performs actual logging. This method must be called for logging to occur. If the call to log() is omitted, a LoggingEvent will be built but no logging will occur.
        Since:
        2.0.0-beta0
      • log

        void log​(java.lang.String message)
        Equivalent to calling setMessage(String) followed by log();
        Parameters:
        message - the message to log
      • log

        void log​(java.lang.String message,
                 java.lang.Object arg)
        Equivalent to calling setMessage(String) followed by addArgument(Object)} and then log()
        Parameters:
        message - the message to log
        arg - an argument to be used with the message to log
      • log

        void log​(java.lang.String message,
                 java.lang.Object arg0,
                 java.lang.Object arg1)
        Equivalent to calling setMessage(String) followed by two calls to addArgument(Object) and then log()
        Parameters:
        message - the message to log
        arg0 - first argument to be used with the message to log
        arg1 - second argument to be used with the message to log
      • log

        void log​(java.lang.String message,
                 java.lang.Object... args)
        Equivalent to calling setMessage(String) followed by zero or more calls to addArgument(Object) (depending on the size of args array) and then log()
        Parameters:
        message - the message to log
        args - a list (actually an array) of arguments to be used with the message to log
      • log

        void log​(java.util.function.Supplier<java.lang.String> messageSupplier)
        Equivalent to calling setMessage(Supplier) followed by log()
        Parameters:
        messageSupplier - a Supplier returning a message of type String