Unified bot.logger and network.logger

This commit is contained in:
Him188 2020-02-19 12:23:09 +08:00
parent c20040f1ac
commit f6ab87f1ef

View File

@ -404,7 +404,14 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
if (packet is CancellableEvent && packet.isCancelled) return
}
logger.info("Received: ${packet.toString().replace("\n", """\n""").replace("\r", "")}")
if (bot.logger.isEnabled || logger.isEnabled) {
val logMessage = "Received: ${packet.toString().replace("\n", """\n""").replace("\r", "")}"
if (packet is Event) {
bot.logger.verbose(logMessage)
}
logger.verbose(logMessage)
}
packetFactory?.run {
when (this) {