Merge pull request #11038 from GoossensMichael/patch-1
Also consider string interpolation
This commit is contained in:
commit
b180037cdc
|
@ -19,7 +19,7 @@ public class MemoryAppender extends ListAppender<ILoggingEvent> {
|
||||||
|
|
||||||
public boolean contains(String string, Level level) {
|
public boolean contains(String string, Level level) {
|
||||||
return this.list.stream()
|
return this.list.stream()
|
||||||
.anyMatch(event -> event.getMessage().toString().contains(string)
|
.anyMatch(event -> event.toString().contains(string)
|
||||||
&& event.getLevel().equals(level));
|
&& event.getLevel().equals(level));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,13 +30,13 @@ public class MemoryAppender extends ListAppender<ILoggingEvent> {
|
||||||
|
|
||||||
public List<ILoggingEvent> search(String string) {
|
public List<ILoggingEvent> search(String string) {
|
||||||
return this.list.stream()
|
return this.list.stream()
|
||||||
.filter(event -> event.getMessage().toString().contains(string))
|
.filter(event -> event.toString().contains(string))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ILoggingEvent> search(String string, Level level) {
|
public List<ILoggingEvent> search(String string, Level level) {
|
||||||
return this.list.stream()
|
return this.list.stream()
|
||||||
.filter(event -> event.getMessage().toString().contains(string)
|
.filter(event -> event.toString().contains(string)
|
||||||
&& event.getLevel().equals(level))
|
&& event.getLevel().equals(level))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue