Package org.elasticsearch.common.logging
Class ChunkedLoggingStreamTestUtils
java.lang.Object
org.elasticsearch.common.logging.ChunkedLoggingStreamTestUtils
Utility for capturing and decoding the data logged by a
ChunkedLoggingStream.-
Method Summary
Modifier and TypeMethodDescriptionstatic BytesReferencegetDecodedLoggedBody(org.apache.logging.log4j.Logger captureLogger, org.apache.logging.log4j.Level level, String prefix, ReferenceDocs referenceDocs, org.elasticsearch.core.CheckedRunnable<Exception> runnable) Test utility function which captures the logged output from aChunkedLoggingStream, combines the chunks, Base64-decodes it and Gzip-decompresses it to retrieve the original data.
-
Method Details
-
getDecodedLoggedBody
public static BytesReference getDecodedLoggedBody(org.apache.logging.log4j.Logger captureLogger, org.apache.logging.log4j.Level level, String prefix, ReferenceDocs referenceDocs, org.elasticsearch.core.CheckedRunnable<Exception> runnable) Test utility function which captures the logged output from aChunkedLoggingStream, combines the chunks, Base64-decodes it and Gzip-decompresses it to retrieve the original data.- Parameters:
captureLogger- The logger whose output should be captured.level- The log level for the data.prefix- The prefix used by the logging stream.referenceDocs- A link to the reference docs about the output.runnable- The action which emits the logs.- Returns:
- A
BytesReferencecontaining the captured data.
-