scribe.LoggingOutputStream.scala Maven / Gradle / Ivy
package scribe
import java.io.OutputStream
import scala.collection.mutable
class LoggingOutputStream(loggerId: LoggerId,
level: Level,
className: String,
methodName: Option[String]) extends OutputStream {
private lazy val b = new mutable.StringBuilder
override def write(byte: Int): Unit = byte.toChar match {
case '\n' => {
Logger(loggerId).logDirect(level, List(b.toString()), className = className, methodName = methodName)
b.clear()
}
case c => b.append(c)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy