public class LoggingContext
extends java.lang.Object
SaveLogRQ to multipart HTTP request to ReportPortal
Basic flow:
After start some test item (suite/test/step) context should be initialized with observable of
item ID and ReportPortal client.
Before actual finish of test item, context should be closed/completed.
Context consists of Flowable with buffering back-pressure strategy to be able
to batch incoming log messages into one requestinit(Maybe)| Modifier and Type | Method and Description |
|---|---|
static LoggingContext |
context()
Return current logging context attached to the current thread.
|
static void |
dispose()
Disposes current logging context
|
void |
emit(java.util.function.Function<java.lang.String,com.epam.ta.reportportal.ws.model.log.SaveLogRQ> logSupplier)
Emits log.
|
void |
emit(io.reactivex.Maybe<java.lang.String> logItemUuid,
java.util.function.Function<java.lang.String,com.epam.ta.reportportal.ws.model.log.SaveLogRQ> logSupplier)
Emits log.
|
static LoggingContext |
init(io.reactivex.Maybe<java.lang.String> itemUuid)
Initializes new logging context and attaches it to current thread
|
@Nullable public static LoggingContext context()
@Nonnull public static LoggingContext init(@Nonnull io.reactivex.Maybe<java.lang.String> itemUuid)
itemUuid - a Test Item UUIDpublic static void dispose()
public void emit(@Nonnull
io.reactivex.Maybe<java.lang.String> logItemUuid,
@Nonnull
java.util.function.Function<java.lang.String,com.epam.ta.reportportal.ws.model.log.SaveLogRQ> logSupplier)
logItemUuid - Test Item ID promiselogSupplier - Log Message Factory. Key if the function is actual test item IDpublic void emit(@Nonnull
java.util.function.Function<java.lang.String,com.epam.ta.reportportal.ws.model.log.SaveLogRQ> logSupplier)
logSupplier - Log Message Factory. Key if the function is actual test item ID