25 lines
932 B
Kotlin
25 lines
932 B
Kotlin
package dev.inmo.kslog.common
|
|
|
|
import kotlin.js.Console
|
|
|
|
external interface ExtendedConsole : Console {
|
|
fun trace()
|
|
fun debug(vararg o: Any?)
|
|
fun assert(assertion: Boolean, vararg o: Any?)
|
|
}
|
|
|
|
/**
|
|
* [https://developer.mozilla.org/en-US/docs/Web/API/console/debug_static](https://developer.mozilla.org/en-US/docs/Web/API/console/debug_static)
|
|
*/
|
|
fun Console.debug(vararg args: Any?) = unsafeCast<ExtendedConsole>().debug(*args)
|
|
|
|
/**
|
|
* [https://developer.mozilla.org/en-US/docs/Web/APtraceI/console/assert_static](https://developer.mozilla.org/en-US/docs/Web/API/console/assert_static)
|
|
*/
|
|
fun Console.assert(assertion: Boolean, vararg args: Any?) = unsafeCast<ExtendedConsole>().assert(assertion, *args)
|
|
|
|
/**
|
|
* [https://developer.mozilla.org/en-US/docs/Web/API/console/trace_static](https://developer.mozilla.org/en-US/docs/Web/API/console/trace_static)
|
|
*/
|
|
fun Console.trace() = unsafeCast<ExtendedConsole>().trace()
|