Skip to content

Instantly share code, notes, and snippets.

@vamjakuldip
Created January 24, 2020 06:36
Show Gist options
  • Save vamjakuldip/f7edd4766b03ec8f8cb2979a52d16e6a to your computer and use it in GitHub Desktop.
Save vamjakuldip/f7edd4766b03ec8f8cb2979a52d16e6a to your computer and use it in GitHub Desktop.
Log Extensin Print log for debug mode
package com.vk.android.extension
import android.util.Log
import com.vk.android.BuildConfig
inline fun <reified T : Any> T.logD(text: String) {
if (BuildConfig.DEBUG)
Log.d(T::class.java.simpleName, text)
}
inline fun <reified T : Any> T.logE(text: String) {
if (BuildConfig.DEBUG)
Log.e(T::class.java.simpleName, text)
}
inline fun <reified T : Any> T.logI(text: String) {
if (BuildConfig.DEBUG)
Log.i(T::class.java.simpleName, text)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment