mirai-core / net.mamoe.mirai.utils / SilentLogger

SilentLogger

object SilentLogger : PlatformLogger

不做任何事情的 logger, keep silent.

Properties

identity

日志的标记. 在 Mirai 中, identity 可为

val identity: String?

Functions

debug0

fun debug0(message: String?): Unit

error0

fun error0(message: String?): Unit

info0

fun info0(message: String?): Unit

verbose0

fun verbose0(message: String?): Unit

warning0

fun warning0(message: String?): Unit

Extension Functions

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