mirror of https://github.com/sbt/sbt.git
reimplement stack trace suppression
Fixes #4964 Together with https://github.com/sbt/util/pull/211, this brings back stack trace supression for custom tasks by default. Debug levels logs are available in `last`, and this prints a message informing the user of the fact. BLUE on dark background is difficult to read, so I am chaning the color hilight to MAGENTA.
This commit is contained in:
parent
740936e156
commit
ecb0375de2
|
|
@ -12,7 +12,6 @@ import java.io.PrintWriter
|
||||||
import Def.ScopedKey
|
import Def.ScopedKey
|
||||||
import Scope.GlobalScope
|
import Scope.GlobalScope
|
||||||
import Keys.{ logLevel, logManager, persistLogLevel, persistTraceLevel, sLog, traceLevel }
|
import Keys.{ logLevel, logManager, persistLogLevel, persistTraceLevel, sLog, traceLevel }
|
||||||
import scala.Console.{ BLUE, RESET }
|
|
||||||
import sbt.internal.util.{
|
import sbt.internal.util.{
|
||||||
AttributeKey,
|
AttributeKey,
|
||||||
ConsoleAppender,
|
ConsoleAppender,
|
||||||
|
|
@ -177,9 +176,14 @@ object LogManager {
|
||||||
val display = Project.showContextKey(state)
|
val display = Project.showContextKey(state)
|
||||||
def commandBase = "last " + display.show(unwrapStreamsKey(key))
|
def commandBase = "last " + display.show(unwrapStreamsKey(key))
|
||||||
def command(useFormat: Boolean) =
|
def command(useFormat: Boolean) =
|
||||||
if (useFormat) BLUE + commandBase + RESET else s"'$commandBase'"
|
if (useFormat) s"${scala.Console.MAGENTA}$commandBase${scala.Console.RESET}"
|
||||||
context =>
|
else s"'$commandBase'"
|
||||||
Some("Stack trace suppressed: run %s for the full output.".format(command(context.useFormat)))
|
|
||||||
|
{ context =>
|
||||||
|
Some(
|
||||||
|
s"stack trace is suppressed; run ${command(context.useFormat)} for the full output"
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def unwrapStreamsKey(key: ScopedKey[_]): ScopedKey[_] = key.scope.task match {
|
def unwrapStreamsKey(key: ScopedKey[_]): ScopedKey[_] = key.scope.task match {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ object Dependencies {
|
||||||
|
|
||||||
// sbt modules
|
// sbt modules
|
||||||
private val ioVersion = nightlyVersion.getOrElse("1.3.0-M16")
|
private val ioVersion = nightlyVersion.getOrElse("1.3.0-M16")
|
||||||
private val utilVersion = nightlyVersion.getOrElse("1.3.0-M9")
|
private val utilVersion = nightlyVersion.getOrElse("1.3.0-M10")
|
||||||
private val lmVersion =
|
private val lmVersion =
|
||||||
sys.props.get("sbt.build.lm.version") match {
|
sys.props.get("sbt.build.lm.version") match {
|
||||||
case Some(version) => version
|
case Some(version) => version
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue