Add soutv for debugging purposes

This commit is contained in:
Him188 2020-04-11 18:24:52 +08:00
parent 1e93da9a09
commit 16d6c56202

View File

@ -11,6 +11,8 @@
package net.mamoe.mirai.qqandroid.utils
import net.mamoe.mirai.utils.DefaultLogger
import net.mamoe.mirai.utils.debug
import kotlin.reflect.KClass
import kotlin.reflect.KProperty
import kotlin.reflect.KProperty1
@ -26,6 +28,12 @@ private fun <T> Sequence<T>.joinToStringPrefixed(prefix: String, transform: (T)
return this.joinToString(prefix = "$prefix$indent", separator = "\n$prefix$indent", transform = transform)
}
private val SoutvLogger by lazy { DefaultLogger("soutv") }
internal fun Any?.soutv(name: String) {
@Suppress("DEPRECATION")
SoutvLogger.debug { "$name = ${this._miraiContentToString()}" }
}
/**
* 将内容格式化为较可读的字符串输出.
*