Logging (UI Layer)#
HaapiLogger is shared across all layers — Driver, SDK, and UIKit / UIWidget — so a single configuration covers the entire stack. The UI Layer adds UI follow-up tags (HAAPI_UI_*) on top of the Driver and SDK sets. Configure it once at app startup; include every layer’s tags so you can filter to whichever subsystem is misbehaving.
For the concept (severity ordering, sensitive-value masking, custom sinks), see Logging and Observability . For the Driver and SDK layer pages, see Logging (Driver Layer) and Logging (SDK Layer) .
What the UI Layer Adds#
If you’ve already configured HaapiLogger for the SDK Layer, the only UI-specific delta is the UI follow-up tag set — tag prefixes such as HAAPI_UI_FLOW, HAAPI_UI_VIEWCONTROLLER / HAAPI_UI_FRAGMENT, HAAPI_UI_THEMING, and HAAPI_UI_DEEPLINK that identify records emitted by view controllers, fragments, theming engine, and the flow-controller / activity.
Configure UI-Layer logging when you need to:
- Diagnose theming issues —
HAAPI_UI_THEMINGemits warnings for missing or mistyped style keys. - Trace screen transitions —
HAAPI_UI_VIEWCONTROLLER/HAAPI_UI_FRAGMENTcovers lifecycle events for each rendered step. - Investigate deep-link delivery —
HAAPI_UI_DEEPLINKshows whether the framework received an inbound deep link after an external redirect.
If your app stays at the SDK Layer (custom UI, no HaapiUIKitApplication / HaapiUIWidgetApplication), the UI follow-up tags don’t fire; skip the UI-tag wiring.
Configuration#
The pattern matches the SDK Layer — on iOS, HaapiLogger.followUpTags is an emission gate (default empty array → nothing logs; the UI Layer requires UIKitFollowUpTag.allCases). On Android, tags have no behavioural effect on emission — gating is via enabled and setLevel(...) only, and tags travel through to your sink as labels. If you want UI-only output, filter by tag prefix inside your LogSink.log(...) or at the LogCat command line.
Combine Driver, SDK, and UI follow-up tags when configuring in AppDelegate.application(_:didFinishLaunchingWithOptions:):
HaapiLogger.followUpTags = DriverFollowUpTag.allCases
+ SdkFollowUpTag.allCases
+ UIKitFollowUpTag.allCases
HaapiLogger.setLogType(LogType.info)Omit UIKitFollowUpTag.allCases and you silently lose every UI-layer record — a common cause of “the SDK looks fine but I can’t see anything from the screens”.
Configure in Application.onCreate. UI Layer records flow through alongside Driver and SDK records once the logger is enabled; filter at the sink or by LogCat tag prefix.
class ClientApplication : Application(), HaapiUIWidgetApplication {
override fun onCreate() {
super.onCreate()
HaapiLogger.enabled = true
HaapiLogger.setLevel(HaapiLogger.LogLevel.INFO)
}
override val widgetConfiguration: WidgetConfiguration = /* ... */
}In DEBUG builds, enabled defaults to true and the level defaults to VERBOSE; release builds default to off. Filter LogCat with logcat -s 'HAAPI_UI_*:V' to focus on the UI Layer.
Sensitive-Value Masking#
HaapiLogger.isSensitiveValueMasked defaults to true and should remain true in any non-development build. The UI Layer composes the SDK Layer, which is where access tokens, refresh tokens, DPoP proofs, and dpop-nonce headers flow — disabling masking surfaces them all in log output. When disabled, the logger emits an explicit warning every time it prints an unmasked sensitive value so the misconfiguration is hard to miss.
Setting isSensitiveValueMasked = false in a release build leaks the OAuth tokens and DPoP material handled by the underlying SDK Layer into application logs. If those logs ship to a third-party crash reporter or observability backend, the leak follows them. Keep masking on outside of local debugging, and never combine isSensitiveValueMasked = false with a remote log sink.
Custom Sinks#
Register a LogSink implementation to route every log record (including UI-Layer ones) into your host application’s logger or crash reporter. The sink mechanism is identical across layers — a single registered sink receives Driver, SDK, and UI-Layer records, distinguished by their HAAPI_DRIVER_* / HAAPI_SDK_* / HAAPI_UI_* follow-up tag. The UI Layer adds no new sink surface; it just emits additional tags that flow through the same sink.
See Logging (SDK Layer) for the per-platform LogSink implementation and registration code.
How to implement this: Logging (SDK Layer) · Logging (Driver Layer) · Logging and Observability (concept) · How to Customize Logging