Skip to content

JVM: logger for the inner class has the name as a parent class #495

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

Open
scrat98 opened this issue Apr 6, 2025 · 1 comment
Open

JVM: logger for the inner class has the name as a parent class #495

scrat98 opened this issue Apr 6, 2025 · 1 comment

Comments

@scrat98
Copy link
Contributor

scrat98 commented Apr 6, 2025

In JVM, logger for the inner class has the name as a parent class.

I think it should be documented at least. Or fixed if required.

Example:

class Base {
  class Inner {
    private companion object {
      private val logger = KotlinLogging.logger { }
    }

    init {
      logger.info { "Hello" }
    }
  }
}

fun main() {
  Base.Inner()
}
18:28:14.314 [main] INFO  io.github.oshai.kotlinlogging.internal.Base - Hello
@oshai
Copy link
Owner

oshai commented Apr 16, 2025

I think this was an older implementation not used anymore. I will add it to the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants