| Modifier and Type | Method and Description |
|---|---|
static void |
disableCapture()
Disable capturing, forgetting about the logger set via
enableCaptureWith(Logger). |
static void |
enableCaptureWith(Logger testLogger)
Set the logger used for capturing.
|
static Disposable |
useCurrentLoggersWithCapture()
Sets a
logger factory that will return loggers that not only use the
original logging framework used by reactor, but also use the logger set via enableCaptureWith(Logger), irrespective
of its name or how it was obtained. |
public static Disposable useCurrentLoggersWithCapture() throws IllegalStateException
logger factory that will return loggers that not only use the
original logging framework used by reactor, but also use the logger set via enableCaptureWith(Logger), irrespective
of its name or how it was obtained. The expectation here is that tests that want to assess that something is
logged by reactor will pass a TestLogger instance to enableCaptureWith(Logger), trigger the operation
under scrutiny, assert the logger contents and reset state by calling disableCapture().
This method should be called very early in the application/tests lifecycle, before reactor classes have created their loggers.
IllegalStateExceptionpublic static void enableCaptureWith(Logger testLogger)
IllegalStateException - if a previous logger has been set but not cleared via disableCapture()public static void disableCapture()
enableCaptureWith(Logger).