All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.kotlin.util.WithLogger.kt Maven / Gradle / Ivy

There is a newer version: 2.1.0-RC
Show newest version
package org.jetbrains.kotlin.util

import kotlin.system.exitProcess

interface Logger {
    fun log(message: String)
    fun error(message: String)
    fun warning(message: String)
    fun fatal(message: String): Nothing
}

interface WithLogger {
    val logger: Logger
}

object DummyLogger : Logger {
    override fun log(message: String) = println(message)
    override fun error(message: String) = println("e: $message")
    override fun warning(message: String) = println("w: $message")
    override fun fatal(message: String): Nothing {
        println("e: $message")
        exitProcess(1)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy