aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/ca/allanwang/kau/logging/KauLogger.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-12-30 16:19:41 -0500
committerAllan Wang <me@allanwang.ca>2018-12-30 16:19:41 -0500
commit3aa909f055c24d3700fa02f80c88e77a0c096f6e (patch)
tree8b700f0ccac3c526ec193002cf18f810d55257c3 /core/src/main/kotlin/ca/allanwang/kau/logging/KauLogger.kt
parentf931e55d534e6162748f9fa888e7313cc2f0b619 (diff)
downloadkau-3aa909f055c24d3700fa02f80c88e77a0c096f6e.tar.gz
kau-3aa909f055c24d3700fa02f80c88e77a0c096f6e.tar.bz2
kau-3aa909f055c24d3700fa02f80c88e77a0c096f6e.zip
Build main dispatcher from handler, resolves #182
Diffstat (limited to 'core/src/main/kotlin/ca/allanwang/kau/logging/KauLogger.kt')
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/logging/KauLogger.kt6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/logging/KauLogger.kt b/core/src/main/kotlin/ca/allanwang/kau/logging/KauLogger.kt
index d01859f..4562b00 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/logging/KauLogger.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/logging/KauLogger.kt
@@ -17,8 +17,8 @@
package ca.allanwang.kau.logging
-import android.os.Looper
import android.util.Log
+import ca.allanwang.kau.utils.kauIsMainThread
/**
* Created by Allan Wang on 2017-05-28.
@@ -82,7 +82,7 @@ open class KauLogger(
inline fun checkThread(id: Int) {
d {
val name = Thread.currentThread().name
- val status = if (Looper.myLooper() == Looper.getMainLooper()) "is" else "is not"
+ val status = if (kauIsMainThread) "is" else "is not"
"$id $status in the main thread - thread name: $name"
}
}
@@ -120,7 +120,7 @@ class KauLoggerExtension(val tag: String, val logger: KauLogger) {
inline fun checkThread(id: Int) {
d {
val name = Thread.currentThread().name
- val status = if (Looper.myLooper() == Looper.getMainLooper()) "is" else "is not"
+ val status = if (kauIsMainThread) "is" else "is not"
"$id $status in the main thread - thread name: $name"
}
}