diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt index c773ae00d..5f0982544 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt @@ -487,12 +487,14 @@ internal class QQAndroidBotNetworkHandler(coroutineContext: CoroutineContext, bo ) { // highest priority: pass to listeners (attached by sendAndExpect). if (packet != null && (bot.logger.isEnabled || logger.isEnabled)) { - when (packet) { - is Packet.NoLog -> { + when { + packet is Packet.NoLog -> { // nothing to do } - is MessageEvent -> packet.logMessageReceived() - is Event -> bot.logger.verbose { "Event: ${packet.toString().singleLine()}" } + packet is MessageEvent -> packet.logMessageReceived() + packet is Event && packet !is Packet.NoEventLog -> bot.logger.verbose { + "Event: ${packet.toString().singleLine()}" + } else -> logger.verbose { "Recv: ${packet.toString().singleLine()}" } } } diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/login/ConfigPushSvc.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/login/ConfigPushSvc.kt index 2aa225d6b..0ba8456a4 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/login/ConfigPushSvc.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/login/ConfigPushSvc.kt @@ -40,7 +40,7 @@ internal class ConfigPushSvc { ) { override val canBeCached: Boolean get() = false - sealed class PushReqResponse : Packet, Event, AbstractEvent() { + sealed class PushReqResponse : Packet, Event, AbstractEvent(), Packet.NoEventLog { class Success( val struct: PushReqJceStruct ) : PushReqResponse() { diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/qqandroid.network/Packet.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/qqandroid.network/Packet.kt index 787d5357d..a7b9201c0 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/qqandroid.network/Packet.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/qqandroid.network/Packet.kt @@ -1,5 +1,6 @@ package net.mamoe.mirai.qqandroid.network +import net.mamoe.mirai.event.Event import net.mamoe.mirai.utils.MiraiInternalAPI /** @@ -14,4 +15,9 @@ interface Packet { * 实现这个接口的包将不会被记录到日志中 */ interface NoLog + + /** + * 实现这个接口的 [Event] 不会被作为事件记录到日志中 + */ + interface NoEventLog }