Skip to content

Instantly share code, notes, and snippets.

@berkutta
berkutta / logging.kt
Created May 9, 2019 11:53 — forked from tomaszpolanski/logging.kt
RxLogging
@file:Suppress("NOTHING_TO_INLINE")
import android.util.Log
import io.reactivex.*
inline fun <reified T> printEvent(tag: String, success: T?, error: Throwable?) =
when {
success == null && error == null -> Log.d(tag, "Complete") /* Only with Maybe */
success != null -> Log.d(tag, "Success $success")
error != null -> Log.d(tag, "Error $error")