diff --git a/simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/bot/OneBotBot.kt b/simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/bot/OneBotBot.kt index d3901ae..131ffe0 100644 --- a/simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/bot/OneBotBot.kt +++ b/simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/bot/OneBotBot.kt @@ -57,6 +57,11 @@ import kotlin.jvm.JvmSynthetic * 且在重新连接的过程中始终失败并达到了重试次数上限,此时会话中的任务会被视为因异常结束, * 并连带 [OneBotBot] 的任务一同终结。 * + * ### 日志 + * + * [OneBotBot] 的内部会输出三种日志: + * - `love.forte.simbot.component.onebot.v11.core.bot.OneBotBot.$uniqueId` + * bot的基本日志,例如连接信息、接收到的原始事件等debug日志。 * * @author ForteScarlet */ diff --git a/simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/bot/internal/OneBotBotImpl.kt b/simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/bot/internal/OneBotBotImpl.kt index f8e86ff..5669cbb 100644 --- a/simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/bot/internal/OneBotBotImpl.kt +++ b/simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/bot/internal/OneBotBotImpl.kt @@ -102,6 +102,11 @@ internal class OneBotBotImpl( private val eventProcessor: EventProcessor, baseDecoderJson: Json, ) : OneBotBot, JobBasedBot() { + companion object { + private const val BASE_LOGGER_NAME = + "love.forte.simbot.component.onebot.v11.core.bot.OneBotBot" + } + override val subContext = coroutineContext.minusKey(Job) override val decoderJson: Json = Json(baseDecoderJson) { configuration.serializersModule?.also { confMd -> @@ -109,10 +114,7 @@ internal class OneBotBotImpl( } } - internal val logger = LoggerFactory - .getLogger( - "love.forte.simbot.component.onebot.v11.core.bot.OneBotBot.$uniqueId" - ) + internal val logger = LoggerFactory.getLogger("$BASE_LOGGER_NAME.$uniqueId") private val eventServerHost = configuration.eventServerHost private val connectMaxRetryTimes = configuration.wsConnectMaxRetryTimes