diff --git a/logcapture-core/src/main/java/org/logcapture/LogCapture.java b/logcapture-core/src/main/java/org/logcapture/LogCapture.java index f1dfb6b..f40009c 100644 --- a/logcapture-core/src/main/java/org/logcapture/LogCapture.java +++ b/logcapture-core/src/main/java/org/logcapture/LogCapture.java @@ -34,4 +34,8 @@ public LogCapture logged(Matcher> expectedLoggingMessage, } return this; } + + public List getEvents() { + return Collections.unmodifiableList(events); + } } diff --git a/logcapture-junit5/src/main/java/org/logcapture/junit5/LogCaptureExtension.java b/logcapture-junit5/src/main/java/org/logcapture/junit5/LogCaptureExtension.java index 90e6c8d..2ba4804 100644 --- a/logcapture-junit5/src/main/java/org/logcapture/junit5/LogCaptureExtension.java +++ b/logcapture-junit5/src/main/java/org/logcapture/junit5/LogCaptureExtension.java @@ -48,4 +48,8 @@ public LogCapture logged(Matcher> expectedLoggingMessage) { public LogCapture logged(Matcher> expectedLoggingMessage, Integer times) { return new LogCapture<>(logAppender.events()).logged(expectedLoggingMessage, times); } + + public List getEvents() { + return logAppender.events(); + } }