mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Fix MiraiConsoleLoggerUnused.isEnabled
This commit is contained in:
parent
e9de080a96
commit
1d88a9d942
@ -112,6 +112,7 @@ internal object MiraiConsoleImplementationBridge : CoroutineScope, MiraiConsoleI
|
||||
ConsoleDataScope.addAndReloadConfig(LoggerConfig)
|
||||
}
|
||||
}
|
||||
|
||||
phase `greeting`@{
|
||||
val buildDateFormatted =
|
||||
buildDate.atZone(ZoneId.systemDefault()).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
|
||||
@ -120,6 +121,7 @@ internal object MiraiConsoleImplementationBridge : CoroutineScope, MiraiConsoleI
|
||||
mainLogger.info { "Backend: version $version, built on $buildDateFormatted." }
|
||||
mainLogger.info { frontEndDescription.render() }
|
||||
}
|
||||
|
||||
phase `check coroutineContext`@{
|
||||
if (coroutineContext[Job] == null) {
|
||||
throw MalformedMiraiConsoleImplementationError("The coroutineContext given to MiraiConsole must have a Job in it.")
|
||||
|
@ -45,17 +45,12 @@ internal class MiraiConsoleLoggerUnused(
|
||||
delegateLogger.logger = logger
|
||||
logger
|
||||
}
|
||||
override val isEnabled: Boolean
|
||||
get() = super.isEnabled
|
||||
override val isEnabled: Boolean get() = logger.isEnabled
|
||||
|
||||
override fun debug0(message: String?, e: Throwable?) = logger.debug(message, e)
|
||||
|
||||
override fun error0(message: String?, e: Throwable?) = logger.error(message, e)
|
||||
|
||||
override fun info0(message: String?, e: Throwable?) = logger.info(message, e)
|
||||
|
||||
override fun verbose0(message: String?, e: Throwable?) = logger.verbose(message, e)
|
||||
|
||||
override fun warning0(message: String?, e: Throwable?) = logger.warning(message, e)
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user