Skip to content

Commit

Permalink
Expose logging events, to allow asserting with other frameworks.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-jepsen committed Apr 26, 2024
1 parent 93c38cb commit fde3fe0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
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
Expand Up @@ -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
Expand Up @@ -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();
}
}

0 comments on commit fde3fe0

Please sign in to comment.