Scala porting of Patrick Kua class for capturing Logback appenders output.
Add to build.sbt
(replace x.x.x with the appropriate version):
libraryDependencies += "com.github.francescopellegrini" %% "logback-capturing-appender" % "x.x.x"
val capturingAppender = LogbackCapturingAppender(slf4jLogger).startCapturing()
// log some messages
// Get all events logged at the configured level
capturingAppender.loggedEvents