[console/logging] Always load LoggerConfig; Add LoggerConfig.Binding settings

This commit is contained in:
Karlatemp 2022-11-10 17:48:33 +08:00 committed by Him188
parent 8a07308a56
commit 7537e29b0e
2 changed files with 14 additions and 0 deletions

View File

@ -36,6 +36,7 @@ import net.mamoe.mirai.console.internal.data.builtins.AutoLoginConfig.Account.Co
import net.mamoe.mirai.console.internal.data.builtins.AutoLoginConfig.Account.PasswordKind.MD5
import net.mamoe.mirai.console.internal.data.builtins.AutoLoginConfig.Account.PasswordKind.PLAIN
import net.mamoe.mirai.console.internal.data.builtins.DataScope
import net.mamoe.mirai.console.internal.data.builtins.LoggerConfig
import net.mamoe.mirai.console.internal.data.builtins.PluginDependenciesConfig
import net.mamoe.mirai.console.internal.extension.GlobalComponentStorage
import net.mamoe.mirai.console.internal.extension.GlobalComponentStorageImpl
@ -268,6 +269,8 @@ ___ ____ _ _____ _
val loggerController = loggerController
if (loggerController is LoggerControllerImpl) {
consoleDataScope.addAndReloadConfig(loggerController.loggerConfig)
} else {
consoleDataScope.addAndReloadConfig(LoggerConfig())
}
consoleDataScope.reloadAll()
if (loggerController is LoggerControllerImpl) {

View File

@ -9,6 +9,7 @@
package net.mamoe.mirai.console.internal.data.builtins
import kotlinx.serialization.Serializable
import net.mamoe.mirai.console.ConsoleFrontEndImplementation
import net.mamoe.mirai.console.data.ReadOnlyPluginConfig
import net.mamoe.mirai.console.data.ValueDescription
@ -40,4 +41,14 @@ public class LoggerConfig : ReadOnlyPluginConfig("Logger") {
)
)
@Serializable
public class Binding @MiraiExperimentalApi public constructor(
)
@ValueDescription(
"""
是否启动外部日志框架桥接
"""
)
public val binding: Binding by value { Binding() }
}