Logging (Driver Layer)#

HaapiLogger is shared across all layers — Driver, SDK, and UIKit/UIWidget — so a single configuration covers the entire stack. Configure it once at app startup. For the concept (severity ordering, follow-up tags, sensitive-value masking, custom sinks), see Logging and Observability .

Configuration#

Configure in AppDelegate.application(_:didFinishLaunchingWithOptions:):

HaapiLogger.followUpTags = DriverFollowUpTag.allCases
HaapiLogger.setLogType(LogType.info)

Setting a log type enables that level and everything more severe (info enables info, warning, and error). The deprecated isXXXEnabled flags still compile but are scheduled for removal — see Upgrade — HaapiLogger setLogType Migration .

HaapiLogger.followUpTags is an emission gate — it defaults to [], meaning nothing logs until you set it. Setting DriverFollowUpTag.allCases enables every Driver tag (HAAPI_DRIVER_FLOW, HAAPI_DRIVER_HTTP, HAAPI_DRIVER_STORAGE, HAAPI_DRIVER_ATTESTATION); pass a narrower subset to restrict emission to specific subsystems.

Sensitive-Value Masking#

HaapiLogger.isSensitiveValueMasked defaults to true and should remain true in any non-development build. 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 access tokens, refresh tokens, DPoP keys, and other sensitive values into application logs. Keep masking on outside of local debugging.

Custom Sinks#

To route logs into a host application’s observability platform or crash reporter, register a LogSink implementation. The sink receives every log record with its level, follow-up tag, message, file, and line; it can filter, transform, or forward as needed. See Logging and Observability for the sink interface.

Was this helpful?