jstachio / rainbowgum

Fast, Small, JDK 21+, GraalVM native friendly SLF4J logging framework
BSD 3-Clause "New" or "Revised" License
66 stars 3 forks source link

`Throwable` methods don't log anything on `slf4j` binding #70

Closed cmdjulian closed 5 months ago

cmdjulian commented 5 months ago

Not quite sure why, but only the first log statement gets actually logged, the other two invocations don't print anything. Am I doing something wrong here?

private val logger = KotlinLogging.logger {}

fun main() {
    logger.info { "Hello, World!" }
    logger.error(IllegalArgumentException()) { "Hello, World!" }
    logger.error("Hello, World!", IllegalArgumentException())
}

It seems like this is for all logger methods which do include a Throwable in their signature. The logger faced I'm using on top of Rainbowgum is kotlin-logging which relies on slf4j. For other loggers like logback everything works as it should.

I created a small reproducer: logger.zip

agentgt commented 5 months ago

There were numerous bugs in 0.3.0 that I should have filed but instead just fixed. Let me check to see and will shortly get back to you.

agentgt commented 5 months ago

Confirmed. I know it worked at one point but apparently I recently broke it when I regenerated code and the unit test did not test the throwable (how embarrassing). The loggers are code generated.

I'm in the works of having a much more extensive testing suite.

agentgt commented 5 months ago

Pumping out a release now. I guess the static level loggers were not being tested for the throwable non marker calls.

agentgt commented 5 months ago

@cmdjulian 0.4.0 should be in Maven central (or at least it will be propagated shortly).

Thanks a ton for reporting this. By 0.5.0 we should be approaching less experimental and the API will stabilize as well.

cmdjulian commented 5 months ago

Thanks for rainbowgum! 👍🏻