Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose logging events, to allow asserting with other frameworks. #226

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Expose logging events, to allow asserting with other frameworks.
  • Loading branch information
s-jepsen committed Apr 26, 2024
commit fde3fe0feea3c893cae9665db5b62f07c29ce528
4 changes: 4 additions & 0 deletions logcapture-core/src/main/java/org/logcapture/LogCapture.java
Original file line number Diff line number Diff line change
@@ -34,4 +34,8 @@ public LogCapture<T> logged(Matcher<List<ILoggingEvent>> expectedLoggingMessage,
}
return this;
}

public List<ILoggingEvent> getEvents() {
return Collections.unmodifiableList(events);
}
}
Original file line number Diff line number Diff line change
@@ -48,4 +48,8 @@ public LogCapture logged(Matcher<List<ILoggingEvent>> expectedLoggingMessage) {
public LogCapture logged(Matcher<List<ILoggingEvent>> expectedLoggingMessage, Integer times) {
return new LogCapture<>(logAppender.events()).logged(expectedLoggingMessage, times);
}

public List<ILoggingEvent> getEvents() {
return logAppender.events();
}
}