Improve loggers

This commit is contained in:
Karlatemp 2021-09-24 17:01:02 +08:00
parent 6cecb18255
commit 247cdb4414
No known key found for this signature in database
GPG Key ID: 21FBDDF664FF06F8

View File

@ -20,6 +20,18 @@ internal class MiraiConsoleLogger(
) : MiraiLoggerPlatformBase() {
override val identity: String? get() = logger.identity
override val isEnabled: Boolean get() = logger.isEnabled
override val isInfoEnabled: Boolean
get() = controller.shouldLog(identity, SimpleLogger.LogPriority.INFO)
override val isWarningEnabled: Boolean
get() = controller.shouldLog(identity, SimpleLogger.LogPriority.WARNING)
override val isDebugEnabled: Boolean
get() = controller.shouldLog(identity, SimpleLogger.LogPriority.DEBUG)
override val isErrorEnabled: Boolean
get() = controller.shouldLog(identity, SimpleLogger.LogPriority.ERROR)
override val isVerboseEnabled: Boolean
get() = controller.shouldLog(identity, SimpleLogger.LogPriority.VERBOSE)
override fun info0(message: String?, e: Throwable?) {
if (controller.shouldLog(identity, SimpleLogger.LogPriority.INFO))
logger.info(message, e)