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)
|
ConsoleDataScope.addAndReloadConfig(LoggerConfig)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
phase `greeting`@{
|
phase `greeting`@{
|
||||||
val buildDateFormatted =
|
val buildDateFormatted =
|
||||||
buildDate.atZone(ZoneId.systemDefault()).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
|
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 { "Backend: version $version, built on $buildDateFormatted." }
|
||||||
mainLogger.info { frontEndDescription.render() }
|
mainLogger.info { frontEndDescription.render() }
|
||||||
}
|
}
|
||||||
|
|
||||||
phase `check coroutineContext`@{
|
phase `check coroutineContext`@{
|
||||||
if (coroutineContext[Job] == null) {
|
if (coroutineContext[Job] == null) {
|
||||||
throw MalformedMiraiConsoleImplementationError("The coroutineContext given to MiraiConsole must have a Job in it.")
|
throw MalformedMiraiConsoleImplementationError("The coroutineContext given to MiraiConsole must have a Job in it.")
|
||||||
|
@ -45,17 +45,12 @@ internal class MiraiConsoleLoggerUnused(
|
|||||||
delegateLogger.logger = logger
|
delegateLogger.logger = logger
|
||||||
logger
|
logger
|
||||||
}
|
}
|
||||||
override val isEnabled: Boolean
|
override val isEnabled: Boolean get() = logger.isEnabled
|
||||||
get() = super.isEnabled
|
|
||||||
|
|
||||||
override fun debug0(message: String?, e: Throwable?) = logger.debug(message, e)
|
override fun debug0(message: String?, e: Throwable?) = logger.debug(message, e)
|
||||||
|
|
||||||
override fun error0(message: String?, e: Throwable?) = logger.error(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 info0(message: String?, e: Throwable?) = logger.info(message, e)
|
||||||
|
|
||||||
override fun verbose0(message: String?, e: Throwable?) = logger.verbose(message, e)
|
override fun verbose0(message: String?, e: Throwable?) = logger.verbose(message, e)
|
||||||
|
|
||||||
override fun warning0(message: String?, e: Throwable?) = logger.warning(message, e)
|
override fun warning0(message: String?, e: Throwable?) = logger.warning(message, e)
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user