diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/MiraiConsoleImplementationBridge.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/MiraiConsoleImplementationBridge.kt index c67694f6d..628d06c2d 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/MiraiConsoleImplementationBridge.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/MiraiConsoleImplementationBridge.kt @@ -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.") diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/logging/MiraiConsoleLoggerUnused.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/logging/MiraiConsoleLoggerUnused.kt index 064819304..3fc98e568 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/logging/MiraiConsoleLoggerUnused.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/logging/MiraiConsoleLoggerUnused.kt @@ -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) } \ No newline at end of file