diff --git a/backend/mirai-console/src/MiraiConsole.kt b/backend/mirai-console/src/MiraiConsole.kt index 2f7b9eddd..736d1abc9 100644 --- a/backend/mirai-console/src/MiraiConsole.kt +++ b/backend/mirai-console/src/MiraiConsole.kt @@ -171,7 +171,7 @@ public interface MiraiConsole : CoroutineScope { redirectNetworkLogToDirectory() this.botLoggerSupplier = { - MiraiLogger.create("Bot.${it.id}") + MiraiLogger.Factory.create(Bot::class, "Bot.${it.id}") } parentCoroutineContext = MiraiConsole.childScopeContext("Bot $id") autoReconnectOnForceOffline() diff --git a/backend/mirai-console/src/data/AutoSavePluginData.kt b/backend/mirai-console/src/data/AutoSavePluginData.kt index 1177f9978..120f3029b 100644 --- a/backend/mirai-console/src/data/AutoSavePluginData.kt +++ b/backend/mirai-console/src/data/AutoSavePluginData.kt @@ -119,7 +119,7 @@ public open class AutoSavePluginData private constructor( } internal val debuggingLogger1 by lazy { - MiraiLogger.create("console.debug").withSwitch(false) + MiraiLogger.Factory.create(AutoSavePluginData::class, "console.debug").withSwitch(false) } @Suppress("RESULT_CLASS_IN_RETURN_TYPE") diff --git a/frontend/mirai-console-terminal/src/ConsoleThread.kt b/frontend/mirai-console-terminal/src/ConsoleThread.kt index 4e70ff072..745afba0f 100644 --- a/frontend/mirai-console-terminal/src/ConsoleThread.kt +++ b/frontend/mirai-console-terminal/src/ConsoleThread.kt @@ -33,7 +33,7 @@ import org.jline.reader.UserInterruptException import kotlin.reflect.KClass import kotlin.reflect.full.isSubclassOf -val consoleLogger by lazy { MiraiLogger.create("console") } +val consoleLogger by lazy { MiraiLogger.Factory.create(MiraiConsole::class, "console") } @OptIn(ConsoleInternalApi::class, ConsoleTerminalExperimentalApi::class, ExperimentalCommandDescriptors::class) internal fun startupConsoleThread() { diff --git a/frontend/mirai-console-terminal/src/MiraiConsoleTerminalLoader.kt b/frontend/mirai-console-terminal/src/MiraiConsoleTerminalLoader.kt index 30cbe8194..25aa96ab4 100644 --- a/frontend/mirai-console-terminal/src/MiraiConsoleTerminalLoader.kt +++ b/frontend/mirai-console-terminal/src/MiraiConsoleTerminalLoader.kt @@ -169,7 +169,8 @@ internal fun overrideSTD() { System.setOut( PrintStream( BufferedOutputStream( - logger = MiraiLogger.create("stdout").run { ({ line: String? -> info(line) }) } + logger = MiraiLogger.Factory.create(MiraiConsoleTerminalLoader::class, "stdout") + .run { ({ line: String? -> info(line) }) } ), false, "UTF-8" @@ -178,7 +179,8 @@ internal fun overrideSTD() { System.setErr( PrintStream( BufferedOutputStream( - logger = MiraiLogger.create("stderr").run { ({ line: String? -> warning(line) }) } + logger = MiraiLogger.Factory.create(MiraiConsoleTerminalLoader::class, "stderr") + .run { ({ line: String? -> warning(line) }) } ), false, "UTF-8" diff --git a/frontend/mirai-console-terminal/test/RunTerminal.kt b/frontend/mirai-console-terminal/test/RunTerminal.kt index 318799dc4..6dd6693e4 100644 --- a/frontend/mirai-console-terminal/test/RunTerminal.kt +++ b/frontend/mirai-console-terminal/test/RunTerminal.kt @@ -10,6 +10,7 @@ package net.mamoe.mirai.console.terminal import kotlinx.coroutines.runBlocking +import net.mamoe.mirai.Bot import net.mamoe.mirai.console.MiraiConsole import net.mamoe.mirai.console.extensions.BotConfigurationAlterer import net.mamoe.mirai.console.logging.LoggerController @@ -34,7 +35,7 @@ fun main() { BotConfigurationAlterer, mockPlugin, BotConfigurationAlterer { _, configuration -> - configuration.networkLoggerSupplier = { MiraiLogger.create("Net.${it.id}") } // deploy + configuration.networkLoggerSupplier = { MiraiLogger.Factory.create(Bot::class, "Net.${it.id}") } // deploy configuration } ) diff --git a/tools/gradle-plugin/src/main/kotlin/VersionConstants.kt b/tools/gradle-plugin/src/main/kotlin/VersionConstants.kt index 61a055aff..b4914cec7 100644 --- a/tools/gradle-plugin/src/main/kotlin/VersionConstants.kt +++ b/tools/gradle-plugin/src/main/kotlin/VersionConstants.kt @@ -10,6 +10,6 @@ package net.mamoe.mirai.console.gradle internal object VersionConstants { - const val CONSOLE_VERSION = "2.8.0-M1" // value is written here automatically during build - const val CORE_VERSION = "2.8.0-M1" // value is written here automatically during build + const val CONSOLE_VERSION = "2.8.0" // value is written here automatically during build + const val CORE_VERSION = "2.8.0" // value is written here automatically during build } \ No newline at end of file