open class PlatformLogger : MiraiLoggerPlatformBase
当前平台的默认的日志记录器.
在 JVM 控制台 端的实现为 println
在 Android 端的实现为 android.util.Log
不应该直接构造这个类的实例. 请使用 DefaultLogger, 或使用默认的顶层日志记录 MiraiLogger.Companion
<init> |
当前平台的默认的日志记录器.
在 JVM 控制台 端的实现为 println
在 Android 端的实现为 PlatformLogger(identity: String? = "Mirai")
JVM 控制台日志实现 PlatformLogger(identity: String? = "Mirai", output: (String) -> Unit) |
identity |
日志的标记. 在 Mirai 中, identity 可为 open val identity: String? |
output |
open val output: (String) -> Unit |
debug0 |
open fun debug0(message: String?): Unit open fun debug0(message: String?, e: Throwable?): Unit |
error0 |
open fun error0(message: String?): Unit open fun error0(message: String?, e: Throwable?): Unit |
info0 |
open fun info0(message: String?): Unit open fun info0(message: String?, e: Throwable?): Unit |
verbose0 |
open fun verbose0(message: String?): Unit open fun verbose0(message: String?, e: Throwable?): Unit |
warning0 |
open fun warning0(message: String?): Unit open fun warning0(message: String?, e: Throwable?): Unit |
debug |
fun MiraiLogger.debug(lazyMessage: () -> String?): Unit fun MiraiLogger.debug(lazyMessage: () -> String?, e: Throwable?): Unit |
error |
fun MiraiLogger.error(lazyMessage: () -> String?): Unit fun MiraiLogger.error(lazyMessage: () -> String?, e: Throwable?): Unit |
info |
fun MiraiLogger.info(lazyMessage: () -> String?): Unit fun MiraiLogger.info(lazyMessage: () -> String?, e: Throwable?): Unit |
verbose |
fun MiraiLogger.verbose(lazyMessage: () -> String): Unit fun MiraiLogger.verbose(lazyMessage: () -> String, e: Throwable?): Unit |
warning |
fun MiraiLogger.warning(lazyMessage: () -> String?): Unit fun MiraiLogger.warning(lazyMessage: () -> String?, e: Throwable?): Unit |
withSwitch |
给这个 logger 添加一个开关, 用于控制是否记录 log fun MiraiLogger.withSwitch(default: Boolean = true): MiraiLoggerWithSwitch |
SilentLogger |
不做任何事情的 logger, keep silent. object SilentLogger : PlatformLogger |