Skip to content

Commit

Permalink
check for return value in some oggingEventBuilder methods
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed Aug 6, 2022
1 parent e7ca8d1 commit 0dcfa19
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions slf4j-api/src/main/java/org/slf4j/spi/LoggingEventBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

import org.slf4j.Marker;

import javax.annotation.CheckReturnValue;

/**
* This is the main interface in slf4j's fluent API for creating
* {@link org.slf4j.event.LoggingEvent logging events}.
Expand All @@ -42,6 +44,7 @@ public interface LoggingEventBuilder {
* @param cause a throwable
* @return a LoggingEventBuilder, usually <b>this</b>.
*/
@CheckReturnValue
LoggingEventBuilder setCause(Throwable cause);

/**
Expand All @@ -50,6 +53,7 @@ public interface LoggingEventBuilder {
* @param marker a Marker instance to add.
* @return a LoggingEventBuilder, usually <b>this</b>.
*/
@CheckReturnValue
LoggingEventBuilder addMarker(Marker marker);

/**
Expand All @@ -58,6 +62,7 @@ public interface LoggingEventBuilder {
* @param p an Object to add.
* @return a LoggingEventBuilder, usually <b>this</b>.
*/
@CheckReturnValue
LoggingEventBuilder addArgument(Object p);

/**
Expand All @@ -66,6 +71,7 @@ public interface LoggingEventBuilder {
* @param objectSupplier an Object supplier to add.
* @return a LoggingEventBuilder, usually <b>this</b>.
*/
@CheckReturnValue
LoggingEventBuilder addArgument(Supplier<?> objectSupplier);


Expand All @@ -76,6 +82,7 @@ public interface LoggingEventBuilder {
* @param value the value of the key value pair.
* @return a LoggingEventBuilder, usually <b>this</b>.
*/
@CheckReturnValue
LoggingEventBuilder addKeyValue(String key, Object value);

/**
Expand All @@ -85,13 +92,15 @@ public interface LoggingEventBuilder {
* @param valueSupplier a supplier of a value for the key value pair.
* @return a LoggingEventBuilder, usually <b>this</b>.
*/
@CheckReturnValue
LoggingEventBuilder addKeyValue(String key, Supplier<Object> valueSupplier);

/**
* Sets the message of the logging event.
*
* @since 2.0.0-beta0
*/
@CheckReturnValue
LoggingEventBuilder setMessage(String message);

/**
Expand All @@ -100,6 +109,7 @@ public interface LoggingEventBuilder {
* @param messageSupplier supplies a String to be used as the message for the event
* @since 2.0.0-beta0
*/
@CheckReturnValue
LoggingEventBuilder setMessage(Supplier<String> messageSupplier);

/**
Expand Down

0 comments on commit 0dcfa19

Please sign in to comment.