diff options
author | Allan Wang <me@allanwang.ca> | 2017-12-31 02:44:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-31 02:44:46 -0500 |
commit | 725d6a99a07f91f940a07e6b49dd6224a6aa32d1 (patch) | |
tree | 4e0b1b3b9ffe9b5aef3c8d0f154ea9ab1058fd5e /app/src/main/kotlin/com/pitchedapps/frost/services/FrostRequestService.kt | |
parent | 3076d9a97c203497aec1415d8ac6037d10eebb46 (diff) | |
download | frost-725d6a99a07f91f940a07e6b49dd6224a6aa32d1.tar.gz frost-725d6a99a07f91f940a07e6b49dd6224a6aa32d1.tar.bz2 frost-725d6a99a07f91f940a07e6b49dd6224a6aa32d1.zip |
Enhancement/proguard (#589)
* Add error log
* Rewrite logger
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/services/FrostRequestService.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/services/FrostRequestService.kt | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostRequestService.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostRequestService.kt index 2b407b7d..d5311fc0 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostRequestService.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostRequestService.kt @@ -33,7 +33,7 @@ private enum class FrostRequestCommands : EnumBundle<FrostRequestCommands> { override fun invoke(auth: RequestAuth, bundle: PersistableBundle) { val id = bundle.getLong(ARG_0, -1L) val success = auth.markNotificationRead(id).invoke() - L.d("Marked notif $id as read: $success") + L.d { "Marked notif $id as read: $success" } } override fun propagate(bundle: BaseBundle) = @@ -96,7 +96,7 @@ object FrostRunnable { fun markNotificationRead(context: Context, id: Long, cookie: String): Boolean { if (id <= 0) { - L.d("Invalid notification id $id for marking as read") + L.d { "Invalid notification id $id for marking as read" } return false } return schedule(context, FrostRequestCommands.NOTIF_READ, @@ -107,7 +107,7 @@ object FrostRunnable { intent?.extras ?: return val command = FrostRequestCommands[intent] ?: return intent.removeExtra(ARG_COMMAND) // reset - L.d("Propagating command ${command.name}") + L.d { "Propagating command ${command.name}" } val builder = command.propagate(intent.extras) schedule(context, command, builder) } @@ -122,7 +122,7 @@ object FrostRunnable { bundle.putString(ARG_COMMAND, command.name) if (bundle.getCookie().isNullOrBlank()) { - L.e("Scheduled frost request with empty cookie)") + L.e { "Scheduled frost request with empty cookie" } return false } @@ -136,7 +136,7 @@ object FrostRunnable { L.eThrow("FrostRequestService scheduler failed for ${command.name}") return false } - L.d("Scheduled ${command.name}") + L.d { "Scheduled ${command.name}" } return true } @@ -171,10 +171,12 @@ class FrostRequestService : JobService() { val now = System.currentTimeMillis() future = doAsync { cookie.fbRequest { - L.d("Requesting frost service for ${command.name}") + L.d { "Requesting frost service for ${command.name}" } command.invoke(this, bundle) } - L.d("Finished frost service for ${command.name} in ${System.currentTimeMillis() - now} ms") + L.d { + "Finished frost service for ${command.name} in ${System.currentTimeMillis()} - now} ms" + } jobFinished(params, false) } return true |