mirror of https://github.com/sbt/sbt.git
Add timestamp when command completes. Show stack trace for test framework errors.
This commit is contained in:
parent
1e30cb8203
commit
6c45fe1b2f
|
|
@ -398,7 +398,13 @@ class xMain extends xsbti.AppMain
|
|||
val endTime = System.currentTimeMillis()
|
||||
project.log.info("")
|
||||
val ss = if(s.isEmpty) "" else s + " "
|
||||
project.log.info("Total " + ss + "time: " + (endTime - startTime + 500) / 1000 + " s")
|
||||
project.log.info("Total " + ss + "time: " + (endTime - startTime + 500) / 1000 + " s, completed " + nowString)
|
||||
}
|
||||
private def nowString =
|
||||
{
|
||||
import java.text.DateFormat
|
||||
val format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT)
|
||||
format.format(new java.util.Date)
|
||||
}
|
||||
/** Provides a partial message describing why the given property is undefined. */
|
||||
private def undefinedMessage(property: Project#UserProperty[_]): String =
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ object TestLogger
|
|||
def warn(s: String) = log(Level.Warn, s)
|
||||
def info(s: String) = log(Level.Info, s)
|
||||
def debug(s: String) = log(Level.Debug, s)
|
||||
def trace(t: Throwable) = logger.trace(t)
|
||||
private def log(level: Level.Value, s: String) = logger.log(level, s)
|
||||
def ansiCodesSupported() = logger.ansiCodesSupported
|
||||
}
|
||||
|
|
@ -72,8 +73,9 @@ class TestLogger(val log: TLogger) extends TestsListener
|
|||
def testEvent(event: TestEvent): Unit = event.detail.foreach(count)
|
||||
def endGroup(name: String, t: Throwable)
|
||||
{
|
||||
// log.trace(t) : need to add a trace method to org.scalatools.testing.Logger
|
||||
try { log.getClass.getMethod("trace", classOf[Throwable]).invoke(log, t) } catch { case e: Exception => () }
|
||||
log.error("Could not run test " + name + ": " + t.toString)
|
||||
//log.trace(t)
|
||||
}
|
||||
def endGroup(name: String, result: Result.Value) {}
|
||||
protected def count(event: TEvent): Unit =
|
||||
|
|
|
|||
Loading…
Reference in New Issue