We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc1aaf8 commit a2d3838Copy full SHA for a2d3838
akka-testkit/src/test/scala/akka/testkit/WithLogCapturing.scala
@@ -50,10 +50,12 @@ trait WithLogCapturing extends SuiteMixin { this: TestSuite =>
50
/** Adds a prefix to every line printed out during execution of the thunk. */
51
private def withPrefixedOut[T](prefix: String)(thunk: => T): T = {
52
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
+ }
57
val prefixingOut =
- new PrintStream(new OutputStream {
- override def write(b: Int): Unit = oldOut.write(b)
- }) {
58
+ new PrintStream(os) {
59
override def println(x: Any): Unit =
60
oldOut.println(prefix + String.valueOf(x).replaceAllLiterally("\n", s"\n$prefix"))
61
}
0 commit comments