-
-
Notifications
You must be signed in to change notification settings - Fork 122
Optimize the KLoggerNameResolver for jvm #484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
scrat98
added a commit
to scrat98/kotlin-logging
that referenced
this issue
Mar 6, 2025
…don't need to search indexOf multiple times
@oshai Also please note, that KLoggerNameResolver::name(func: () -> Unit) is never used in the tests. Therefore I'm not sure should we apply the same logic for /** get class name for function by the package of the function */
internal actual fun name(func: () -> Unit): String {
return name(func::class)
}
/** get class name for java class (that usually represents kotlin class) */
internal fun name(clazz: KClass<*>): String {
return clazz.java.name.toCleanClassName()
} The problem with that tests rely on the old behavior (with enclosingClass reflection), for example: Arguments.of(
"io.github.oshai.kotlinlogging.internal.BaseClass\$InnerClass\$Obj",
BaseClass.InnerClass.Obj::class.java,
) |
scrat98
added a commit
to scrat98/kotlin-logging
that referenced
this issue
Apr 6, 2025
scrat98
added a commit
to scrat98/kotlin-logging
that referenced
this issue
Apr 6, 2025
scrat98
added a commit
to scrat98/kotlin-logging
that referenced
this issue
Apr 6, 2025
oshai
pushed a commit
that referenced
this issue
Apr 16, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Part 1 of #480
Optimize the KLoggerNameResolver for jvm, since we don't need to search indexOf multiple times.
The text was updated successfully, but these errors were encountered: