1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 00:17:11 -07:00

Minor fix.

This commit is contained in:
Cedric Beust 2015-10-14 04:09:42 -07:00
parent d2e0aa5363
commit bd0889935c
2 changed files with 6 additions and 2 deletions

View file

@ -63,6 +63,10 @@ fun Any.warn(text: String) {
KobaltLogger.logger.warn(javaClass.simpleName, text) KobaltLogger.logger.warn(javaClass.simpleName, text)
} }
fun Any.error(text: String, e: Throwable? = null) {
KobaltLogger.logger.error(javaClass.simpleName, text, e)
}
class Logger(val dev: Boolean) { class Logger(val dev: Boolean) {
val FORMAT = SimpleDateFormat("HH:mm:ss.SSS") val FORMAT = SimpleDateFormat("HH:mm:ss.SSS")
@ -78,7 +82,7 @@ class Logger(val dev: Boolean) {
println(getPattern("D", tag, message)) println(getPattern("D", 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", tag, message)) println(getPattern("***** E", tag, message) + " Exception: " + e?.getMessage())
final fun warn(tag: String, message: String, e: Throwable? = null) = final fun warn(tag: String, message: String, e: Throwable? = null) =
println(getPattern("W", tag, message)) println(getPattern("W", tag, message))

View file

@ -7,7 +7,7 @@ import com.beust.kobalt.maven.Gpg
import com.beust.kobalt.maven.Http import com.beust.kobalt.maven.Http
import com.beust.kobalt.maven.KobaltException import com.beust.kobalt.maven.KobaltException
import com.beust.kobalt.maven.Md5 import com.beust.kobalt.maven.Md5
import com.beust.kobalt.misc.log import com.beust.kobalt.misc.*
import com.google.inject.assistedinject.Assisted import com.google.inject.assistedinject.Assisted
import com.squareup.okhttp.Response import com.squareup.okhttp.Response
import org.jetbrains.annotations.Nullable import org.jetbrains.annotations.Nullable