From 0cb89dec5f7dca0c103866be2fa5605b3e3f529b Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 21 Aug 2021 22:02:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/model/Debug.kt | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/Debug.kt b/app/src/main/java/io/legado/app/model/Debug.kt index 5288f975b..1e58e7eaf 100644 --- a/app/src/main/java/io/legado/app/model/Debug.kt +++ b/app/src/main/java/io/legado/app/model/Debug.kt @@ -34,6 +34,19 @@ object Debug { showTime: Boolean = true, state: Int = 1 ) { + //调试信息始终要执行 + callback?.let { + if ((debugSource != sourceUrl || !print)) return + var printMsg = msg ?: "" + if (isHtml) { + printMsg = HtmlFormatter.format(msg) + } + if (showTime) { + val time = DEBUG_TIME_FORMAT.format(Date(System.currentTimeMillis() - startTime)) + printMsg = "$time $printMsg" + } + it.printLog(state, printMsg) + } if (isChecking) { if (sourceUrl != null && (msg ?: "").length < 30) { var printMsg = msg ?: "" @@ -46,19 +59,6 @@ object Debug { printMsg = "$time $printMsg" debugMessageMap[sourceUrl] = printMsg } - } else { - callback?.let { - if ((debugSource != sourceUrl || !print)) return - var printMsg = msg ?: "" - if (isHtml) { - printMsg = HtmlFormatter.format(msg) - } - if (showTime) { - val time = DEBUG_TIME_FORMAT.format(Date(System.currentTimeMillis() - startTime)) - printMsg = "$time $printMsg" - } - it.printLog(state, printMsg) - } } } }