Created
November 13, 2017 20:33
-
-
Save einarvalgeirsson/45c3cb39b24e9816d6ee63adedad213e to your computer and use it in GitHub Desktop.
Avoid having to declare TAG in all your class files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val Any.TAG: String | |
get() { | |
val klass = this.javaClass | |
return if(klass.isAnonymousClass) { | |
klass.enclosingClass.simpleName | |
} else { | |
klass.simpleName | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment