Target filter
Search Kotlin docs
  • Platforms
  • Tealium Prism Kotlin
core/com.tealium.prism.core.api.logger/logIfWarnEnabled

logIfWarnEnabled

inline fun Logger.logIfWarnEnabled(category: String, message: () -> String)

Inlines a check for whether the Logger is currently logging at LogLevel.WARN, before evaluating the message, whilst avoiding an unnecessary anonymous class implementation.

This is equivalent to the following code.

if (logger.shouldLog(LogLevel.WARN) {
logger.warn(category, "some message")
}
Content copied to clipboard

It is therefore not recommended for use before the initial LogLevel has been set during sdk initialization

Generated by Dokka
(c) Tealium 2026