pull/1171/head
gedoor 3 years ago
parent 3906e1a6df
commit f411d8af0f
  1. 10
      app/src/main/java/io/legado/app/model/Debug.kt

@ -33,16 +33,18 @@ object Debug {
showTime: Boolean = true, showTime: Boolean = true,
state: Int = 1 state: Int = 1
) { ) {
if (debugSource != sourceUrl || callback == null || !print) return callback?.let {
if (debugSource != sourceUrl || !print) return
var printMsg = msg ?: "" var printMsg = msg ?: ""
if (isHtml) { if (isHtml) {
printMsg = HtmlFormatter.format(msg) printMsg = HtmlFormatter.format(msg)
} }
if (showTime) { if (showTime) {
printMsg = val time = DEBUG_TIME_FORMAT.format(Date(System.currentTimeMillis() - startTime))
"${DEBUG_TIME_FORMAT.format(Date(System.currentTimeMillis() - startTime))} $printMsg" printMsg = "$time $printMsg"
}
it.printLog(state, printMsg)
} }
callback?.printLog(state, printMsg)
} }
@Synchronized @Synchronized

Loading…
Cancel
Save