I'm using both ways for get the simple class name in Kotlin, but I don't know which the best.
I often use for logging, so I use only into current class, therefore I use this in example bellow.
Someone help me, please.
this::class.simpleName
OR:
this.javaClass.simpleName
It's probably more important to pick one method and be consistent. I doubt there is an established best practice on this particular matter (though you never know). It's also unlikely either of these perform better or worse than the other.
That being said, this.javaclass will only be available when running on the JVM: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm/java-class.html
Whereas this::class I believe is commonly available whether you are targeting JVM, JS or Native. As a rule of thumb, I tend to favor whichever is common across all targets when there is a choice.