Merge pull request #167 from eed3si9n/wip/run-logging

Fixes the stacktrace trimming
This commit is contained in:
eugene yokota 2018-06-27 08:16:07 -04:00 committed by GitHub
commit 3811d2a82e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

View File

@ -421,7 +421,7 @@ class ConsoleAppender private[ConsoleAppender] (
}
private def appendTraceEvent(te: TraceEvent): Unit = {
val traceLevel = getTrace
val traceLevel = if (getTrace < 0) Int.MaxValue else getTrace
val throwableShowLines: ShowLines[Throwable] =
ShowLines[Throwable]((t: Throwable) => {
List(StackTrace.trimmed(t, traceLevel))

View File

@ -13,15 +13,20 @@ object MainAppender {
def multiLogger(log: ManagedLogger, config: MainAppenderConfig): ManagedLogger = {
import config._
// TODO
// console setTrace screenTrace
// backed setTrace backingTrace
// multi: Logger
// val log = LogExchange.logger(loggerName)
LogExchange.unbindLoggerAppenders(log.name)
LogExchange.bindLoggerAppenders(
log.name,
(consoleOpt.toList map { _ -> screenLevel }) :::
(consoleOpt.toList map { appender =>
appender match {
case a: ConsoleAppender =>
a.setTrace(screenTrace)
case _ => ()
}
appender -> screenLevel
}) :::
List(backed -> backingLevel) :::
(extra map { x =>
(x -> Level.Info)

View File

@ -4,7 +4,7 @@
package sbt.internal.util
object StackTrace {
def isSbtClass(name: String) = name.startsWith("sbt") || name.startsWith("xsbt")
def isSbtClass(name: String) = name.startsWith("sbt.") || name.startsWith("xsbt.")
/**
* Return a printable representation of the stack trace associated