Skip to content

Commit a2d3838

Browse files
committed
https://github.com/lampepfl/dotty/issues/8425
1 parent fc1aaf8 commit a2d3838

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

akka-testkit/src/test/scala/akka/testkit/WithLogCapturing.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ trait WithLogCapturing extends SuiteMixin { this: TestSuite =>
5050
/** Adds a prefix to every line printed out during execution of the thunk. */
5151
private def withPrefixedOut[T](prefix: String)(thunk: => T): T = {
5252
val oldOut = Console.out
53+
// https://github.com/lampepfl/dotty/issues/8425
54+
val os = new OutputStream {
55+
override def write(b: Int): Unit = oldOut.write(b)
56+
}
5357
val prefixingOut =
54-
new PrintStream(new OutputStream {
55-
override def write(b: Int): Unit = oldOut.write(b)
56-
}) {
58+
new PrintStream(os) {
5759
override def println(x: Any): Unit =
5860
oldOut.println(prefix + String.valueOf(x).replaceAllLiterally("\n", s"\n$prefix"))
5961
}

0 commit comments

Comments
 (0)