공부
[kotlin] methodName & className
승가비
2022. 7. 19. 23:37
728x90
object CommonUtils {
inline fun methodName(): String = object {}::class.java.enclosingMethod.name
inline fun className(): String = object {}::class.java.enclosingClass.simpleName
}
https://stackoverflow.com/questions/48181751/get-name-of-current-function-in-kotlin
Get name of current function in Kotlin
Update How can I get function name which is currently being execute using Kotlin? I'm trying to get the function name of the function which is currently being execute as below but it's always co...
stackoverflow.com
728x90