As part of my testing, I use EventFilter and TestEventListener to listen for log messages. However, this leads to a massive thread on my command line ... which makes it very difficult to view my tests.
Code example:
it("should send a welcome message to the user", SystemFortressTest) {
val stub = new SubFortressBuildingPermitRefTraitImplStub
EventFilter.debug(message = "SystemFortressExchange: Received Message: SystemOutput(List(JITMP Booted))", occurrences = 1) intercept {
stub.buildASubFortress(SystemFortressBlueprintRef)
}
}
this code works, but it floods me with debug level data because TestEventListener prints by STDOUT by default (since it subclasses the default logger, which is just a direct STDOUT protocol)
I can collapse my own registration abstraction, which sits on top of Akka and filters messages from there before it ever gets into Akka stuff ... so it won’t pollute my command line ... but it’s terribly much if there is a similar solution which is already available.
The problem is that if I use SL4J Logger, this does not work with EventFilter.
source
share