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) | |
|---|---|---|
| iOS | HaapiLogger.isErrorEnabled = true (one per level) | HaapiLogger.setLogType(LogType.info) |
| Android | HaapiLogger.isInfoEnabled = true (one per level) | HaapiLogger.setLevel(HaapiLogger.LogLevel.INFO) |
| Selection mode | Independent — any combination of levels can be active | Severity-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 = falseAfter (recommended)#
HaapiLogger.followUpTags = DriverFollowUpTag.allCases
HaapiLogger.setLogType(LogType.info)
// info enables info, warning, error — matches the previous setupAvailable levels#
| Log type | What it covers |
|---|---|
LogType.error | Application hits an issue preventing one or more functionalities from working |
LogType.warning | Something unexpected happened that might disturb functionality |
LogType.info | Application entered a certain state |
LogType.debug | Information 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
}
}After (recommended)#
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 level | What it covers |
|---|---|
LogLevel.ERROR | Application hits an issue preventing one or more functionalities from working |
LogLevel.WARN | Something unexpected happened that might disturb functionality |
LogLevel.INFO | Application entered a certain state |
LogLevel.DEBUG | Information needed for diagnosing or troubleshooting |
LogLevel.VERBOSE | Full 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/falsewith a singleHaapiLogger.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.,
erroranddebugonly), pick the level that best matches your intent. - Keep
HaapiLogger.isSensitiveValueMasked = truein 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 the next major version. There is no rush — but new code should use setLogType / setLevel exclusively.