mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-07 16:40:43 +08:00
Remove use of deprecated MiraiLogger.TopLevel
This commit is contained in:
parent
ad8cc21ee4
commit
b45ca8df81
@ -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()
|
||||
|
@ -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")
|
||||
|
@ -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() {
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
}
|
||||
)
|
||||
|
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user