From f411d8af0f4b969bccff9b2b8e8669aaa571808d Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 24 Jul 2021 22:57:03 +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 | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 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 272c2aacc..834d53efa 100644 --- a/app/src/main/java/io/legado/app/model/Debug.kt +++ b/app/src/main/java/io/legado/app/model/Debug.kt @@ -33,16 +33,18 @@ object Debug { showTime: Boolean = true, state: Int = 1 ) { - if (debugSource != sourceUrl || callback == null || !print) return - var printMsg = msg ?: "" - if (isHtml) { - printMsg = HtmlFormatter.format(msg) - } - if (showTime) { - printMsg = - "${DEBUG_TIME_FORMAT.format(Date(System.currentTimeMillis() - startTime))} $printMsg" + 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) } - callback?.printLog(state, printMsg) } @Synchronized