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