mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-21 07:56:56 +08:00
Fix ParseErrorPacket
not logged
This commit is contained in:
parent
da9dd1e353
commit
49c6734722
@ -53,9 +53,6 @@ internal class PacketLoggingStrategyImpl(
|
||||
onRight = { packet ->
|
||||
packet ?: return
|
||||
if (!bot.logger.isEnabled && !logger.isEnabled) return
|
||||
if (packet is ParseErrorPacket) {
|
||||
packet.direction.getLogger(bot).error("Exception on parsing packet.", packet.error)
|
||||
}
|
||||
|
||||
if (packet is MultiPacket) {
|
||||
if (packet.isMeaningful) logReceivedImpl(packet, incomingPacket, logger)
|
||||
@ -71,6 +68,9 @@ internal class PacketLoggingStrategyImpl(
|
||||
|
||||
private fun logReceivedImpl(packet: Packet, incomingPacket: IncomingPacket, logger: MiraiLogger) {
|
||||
when (packet) {
|
||||
is ParseErrorPacket -> {
|
||||
packet.direction.getLogger(bot).error("Exception on parsing packet.", packet.error)
|
||||
}
|
||||
is MessageEvent -> packet.logMessageReceived()
|
||||
is Packet.NoLog -> {
|
||||
// nothing to do
|
||||
|
Loading…
Reference in New Issue
Block a user