Skip to content

Instantly share code, notes, and snippets.

@brescia123
Last active November 4, 2016 08:55
Show Gist options
  • Save brescia123/fef687e4f37877a4d02efa611283811c to your computer and use it in GitHub Desktop.
Save brescia123/fef687e4f37877a4d02efa611283811c to your computer and use it in GitHub Desktop.
/* --- Log functions with Tag as caller class name --- */
inline fun <reified T: Any> T.logD(text: String) {
Log.d(T::class.java.simpleName, text)
}
inline fun <reified T: Any> T.logE(text: String) {
Log.e(T::class.java.simpleName, text)
}
inline fun <reified T: Any> T.logI(text: String) {
Log.i(T::class.java.simpleName, text)
}
inline fun <reified T: Any> T.logV(text: String) {
Log.v(T::class.java.simpleName, text)
}
inline fun <reified T: Any> T.logW(text: String) {
Log.w(T::class.java.simpleName, text)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment