mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 00:17:11 -07:00
Better error logging.
This commit is contained in:
parent
b61388f04b
commit
4ca1af597e
2 changed files with 6 additions and 5 deletions
|
@ -1,8 +1,6 @@
|
|||
package com.beust.kobalt.internal
|
||||
|
||||
import com.beust.kobalt.misc.NamedThreadFactory
|
||||
import com.beust.kobalt.misc.ToString
|
||||
import com.beust.kobalt.misc.log
|
||||
import com.beust.kobalt.misc.*
|
||||
import com.google.common.collect.HashMultimap
|
||||
import java.util.concurrent.*
|
||||
|
||||
|
@ -72,7 +70,7 @@ public class DynamicGraphExecutor<T>(val graph: DynamicGraph<T>,
|
|||
} catch(ex: TimeoutException) {
|
||||
log(2, "Time out")
|
||||
} catch(ex: Exception) {
|
||||
log(1, "Tests failed: ${ex.message}")
|
||||
error("Error: ${ex.message}", ex)
|
||||
gotError = true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,9 +47,12 @@ class Logger(val dev: Boolean) {
|
|||
final fun debug(tag: String, message: String) =
|
||||
println(getPattern("D", "Debug ", tag, message))
|
||||
|
||||
final fun error(tag: String, message: String, e: Throwable? = null) =
|
||||
final fun error(tag: String, message: String, e: Throwable? = null) {
|
||||
println(getPattern("***** E", "***** ERROR ", tag, message) +
|
||||
if (e != null) " Exception: " + e.message else "")
|
||||
e?.printStackTrace()
|
||||
}
|
||||
|
||||
|
||||
final fun warn(tag: String, message: String, e: Throwable? = null) =
|
||||
println(getPattern("W", "***** WARNING ", tag, message))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue