pull/1259/head
gedoor 3 years ago
parent c2fa7c4ea1
commit 0cb89dec5f
  1. 26
      app/src/main/java/io/legado/app/model/Debug.kt

@ -34,19 +34,7 @@ object Debug {
showTime: Boolean = true, showTime: Boolean = true,
state: Int = 1 state: Int = 1
) { ) {
if (isChecking) { //调试信息始终要执行
if (sourceUrl != null && (msg ?: "").length < 30) {
var printMsg = msg ?: ""
if (isHtml) {
printMsg = HtmlFormatter.format(msg)
}
if (showTime && debugTimeMap[sourceUrl] != null) {
val time =
DEBUG_TIME_FORMAT.format(Date(System.currentTimeMillis() - debugTimeMap[sourceUrl]!!))
printMsg = "$time $printMsg"
debugMessageMap[sourceUrl] = printMsg
}
} else {
callback?.let { callback?.let {
if ((debugSource != sourceUrl || !print)) return if ((debugSource != sourceUrl || !print)) return
var printMsg = msg ?: "" var printMsg = msg ?: ""
@ -59,6 +47,18 @@ object Debug {
} }
it.printLog(state, printMsg) it.printLog(state, printMsg)
} }
if (isChecking) {
if (sourceUrl != null && (msg ?: "").length < 30) {
var printMsg = msg ?: ""
if (isHtml) {
printMsg = HtmlFormatter.format(msg)
}
if (showTime && debugTimeMap[sourceUrl] != null) {
val time =
DEBUG_TIME_FORMAT.format(Date(System.currentTimeMillis() - debugTimeMap[sourceUrl]!!))
printMsg = "$time $printMsg"
debugMessageMap[sourceUrl] = printMsg
}
} }
} }
} }

Loading…
Cancel
Save