oshai/kotlin-logging

Logging a string is disabled at warn and error levels in LocationIgnorantKLogger

dondod opened this issue · 5 comments

https://github.com/oshai/kotlin-logging/blob/master/src/jvmMain/kotlin/io/github/oshai/slf4j/internal/LocationIgnorantKLogger.kt#L240

This doesn't seem right (checking for trace instead of warn):

  override fun warn(msg: String?) {
    if (isTraceEnabled) {
      underlyingLogger.warn(msg)
    }
  }

same for error:

 override fun error(msg: String?) {
    if (isTraceEnabled) {
      underlyingLogger.error(msg)
    }
  }

Thank you for reporting an issue. See the wiki for documentation and slack for questions.

oshai commented

Thanks for reporting!

oshai commented

Fixed in 4.0.0-beta-18 (I missed one spot so created to releases for it)

Thanks! Looks like the same issue exists with debug and info though:

 override fun debug(msg: String?) {
    if (isTraceEnabled) {
      underlyingLogger.debug(msg)
    }
  }
override fun info(msg: String?) {
    if (isTraceEnabled) {
      underlyingLogger.info(msg)
    }
  }
oshai commented

Thanks! fixed in 4.0.0-beta-19.