Merge pull request #5836 from eatkins/relay-appender

Use null ConsoleOut for RelayAppender
This commit is contained in:
eugene yokota 2020-09-11 05:45:25 -04:00 committed by GitHub
commit f655d91d86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -21,6 +21,13 @@ sealed trait ConsoleOut {
object ConsoleOut {
def systemOut: ConsoleOut = terminalOut
private[sbt] object NullConsoleOut extends ConsoleOut {
override val lockObject: AnyRef = this
override def print(s: String): Unit = {}
override def println(): Unit = {}
override def println(s: String): Unit = {}
override def flush(): Unit = {}
}
private[sbt] def globalProxy: ConsoleOut = Proxy
private[sbt] def setGlobalProxy(out: ConsoleOut): Unit = Proxy.set(out)
private[sbt] def getGlobalProxy: ConsoleOut = Proxy.proxy.get

View File

@ -15,7 +15,7 @@ import sbt.util.Level
class RelayAppender(override val name: String)
extends ConsoleAppender(
name,
ConsoleAppender.Properties.from(ConsoleOut.globalProxy, true, true),
ConsoleAppender.Properties.from(ConsoleOut.NullConsoleOut, true, true),
_ => None
) {
lazy val exchange = StandardMain.exchange