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

Use an object KobaltLogger.

This commit is contained in:
Cedric Beust 2015-10-27 20:32:48 -07:00
parent 48882978f0
commit afb6b8e76f
2 changed files with 7 additions and 11 deletions

View file

@ -1,10 +1,8 @@
package com.beust.kobalt.internal package com.beust.kobalt.internal
import com.beust.kobalt.misc.KobaltLogger
import com.beust.kobalt.misc.NamedThreadFactory import com.beust.kobalt.misc.NamedThreadFactory
import com.beust.kobalt.misc.ToString import com.beust.kobalt.misc.ToString
import com.beust.kobalt.misc.log import com.beust.kobalt.misc.log
import com.beust.kobalt.misc.KobaltLogger.*
import com.google.common.collect.HashMultimap import com.google.common.collect.HashMultimap
import java.util.concurrent.* import java.util.concurrent.*

View file

@ -22,16 +22,14 @@ fun Any.error(text: String, e: Throwable? = null) {
KobaltLogger.logger.error(javaClass.simpleName, text, e) KobaltLogger.logger.error(javaClass.simpleName, text, e)
} }
interface KobaltLogger { object KobaltLogger {
companion object { public var LOG_LEVEL: Int = 1
public var LOG_LEVEL: Int = 1
val logger: Logger get() = val logger: Logger get() =
if (Kobalt.context != null) { if (Kobalt.context != null) {
Logger(Kobalt.context!!.args.dev) Logger(Kobalt.context!!.args.dev)
} else { } else {
Logger(false) Logger(false)
}
} }
} }