This repository was archived by the owner on Apr 11, 2022. It is now read-only.

Description
Currently all logging is buffered inside a ByteString builder,
which let's long running tasks appear unresponsive (e.g. rjs
optimize).
I tried to get my head around the Engine class and implementing a simple
logging trait where other logging implementations, such as sbt.streams,
can easily be wrapped.
However I failed handling the ByteStrings and the context.become calls.
My Logger trait looks essentially like this
trait Logger {
// var in trait?
var outputBuilder = ByteString.newBuilder
def info(msg: => String): Unit
def infoRaw(bytes: => ByteString): Unit = {
outputBuilder ++= bytes
outputBuilder = outputBuilder.result.utf8String match {
case content if !content.contains("\n") => outputBuilder ++= bytes
case content =>
val rest = content.split("\n") match {
case Array(out, rest) => info(out); rest
}
ByteString.newBuilder ++= ByteString(rest, "UTF-8")
}
}
}