Using LogCapturing with BehaviorTestKit

I’ve discovered (and love) the simplicity of the LogCapturing trait for actor tests and seeing the failures (iff they occur).

Unfortunately, it’s not working for me with BehaviorTestKit (presumably because that also captures the logs).

In my current situation, I just want to see which paths the actor is going down in a failing test case - I don’t want to assert any particular logging.

Should log capturing be working/is there a way to make it work?

BehaviorTestKit captures all log entries in a test-kit instance local list, you can access it through BehaviorTestKit#logEntries and clear it with clearLog().

LogCapturing hooks into slf4j and the actual logging infrastructure but with BehaviorTestKit it never even reaches the logging infra.

The magic of LogCapturing (to me as a developer) is that it hooks in to the actual scalatest infrastructure. If tests are failing, I get shown the logs.

I guess the simplest thing I could do would be write logEntries.foreach(entry => logger...) after test and let log capturing print them if it’s a failure, but it’d be nice to be able to hook that in the test in general.