Upgrade — HaapiLogger setLogType Migration#

HaapiLogger’s historical per-level boolean configuration (isErrorEnabled, isInfoEnabled, etc.) is deprecated on both platforms. The replacement is a single severity-ordered setter (setLogType on iOS, setLevel on Android) that enables a log level and everything more severe in one call.

This migration is client-side only — there are no server-side changes. It affects every layer that touches HaapiLogger (Driver, SDK, UI).

For the concept, see Logging and Observability. For per-layer configuration code, see Driver, SDK, and UI Layer logging pages.

Key Changes#

Before (deprecated)After (recommended)
iOSHaapiLogger.isErrorEnabled = true (one per level)HaapiLogger.setLogType(LogType.info)
AndroidHaapiLogger.isInfoEnabled = true (one per level)HaapiLogger.setLevel(HaapiLogger.LogLevel.INFO)
Selection modeIndependent — any combination of levels can be activeSeverity-ordered — a level enables itself and everything more severe

The severity order (highest to lowest priority) is: ERROR > WARNING > INFO > DEBUG (iOS) and ERROR > WARN > INFO > DEBUG > VERBOSE (Android, with VERBOSE as the most detailed level). Setting .info enables error, warning, and info log messages.

Behavior Difference#

The old isXXXEnabled properties allow non-contiguous selections — you could enable error and debug while leaving info and warning disabled. The new setLogType / setLevel API cannot express that; you pick a minimum severity and accept everything above it.

If your previous setup relied on a non-contiguous combination, choose the level that best matches your intent — typically the higher-detail one, since the cost of extra log lines is usually lower than the cost of missing one.

Migration Examples#

Before (deprecated API)#

HaapiLogger.followUpTags = DriverFollowUpTag.allCases
HaapiLogger.isErrorEnabled = true
HaapiLogger.isWarningEnabled = true
HaapiLogger.isInfoEnabled = true
HaapiLogger.isDebugEnabled = false
HaapiLogger.followUpTags = DriverFollowUpTag.allCases
HaapiLogger.setLogType(LogType.info)
// info enables info, warning, error — matches the previous setup

Available levels#

Log typeWhat it covers
LogType.errorApplication hits an issue preventing one or more functionalities from working
LogType.warningSomething unexpected happened that might disturb functionality
LogType.infoApplication entered a certain state
LogType.debugInformation needed for diagnosing issues or troubleshooting

Before (deprecated API)#

class ClientApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        HaapiLogger.enabled = true
        HaapiLogger.isErrorEnabled = true
        HaapiLogger.isWarningEnabled = true
        HaapiLogger.isInfoEnabled = true
        HaapiLogger.isDebugEnabled = false
    }
}
class ClientApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        HaapiLogger.enabled = true
        HaapiLogger.setLevel(HaapiLogger.LogLevel.INFO)
        // INFO enables INFO, WARN, ERROR — matches the previous setup
    }
}

Available levels#

Log levelWhat it covers
LogLevel.ERRORApplication hits an issue preventing one or more functionalities from working
LogLevel.WARNSomething unexpected happened that might disturb functionality
LogLevel.INFOApplication entered a certain state
LogLevel.DEBUGInformation needed for diagnosing or troubleshooting
LogLevel.VERBOSEFull visibility for development; not compiled into release builds

In DEBUG builds, enabled defaults to true and the level defaults to VERBOSE. Release builds default both off.

Migration Checklist#

  • Replace any use of HaapiLogger.isXXXEnabled = true/false with a single HaapiLogger.setLogType(...) / HaapiLogger.setLevel(...) call at app startup.
  • Choose the minimum log level you want to see — all levels with higher severity are automatically enabled.
  • If your previous setup enabled a non-contiguous combination (e.g., error and debug only), pick the level that best matches your intent.
  • Keep HaapiLogger.isSensitiveValueMasked = true in non-development builds — this is unchanged by the migration but worth confirming. See Logging (SDK Layer).

Backward Compatibility#

The deprecated isXXXEnabled properties continue to compile and work in the current version. They will be removed in a future major version. There is no rush — but new code should use setLogType / setLevel exclusively.

Was this helpful?