Obfuscation & Omission

Obfuscate sensitive data and omit specific network logs in KMP.

Before network data is sent to the native Luciq SDK, you can modify it (obfuscation) or prevent it from being logged (omission).

Obfuscate logs

Use NetworkLoggerKmp.obfuscateLog to strip or mask sensitive data (e.g. auth headers, tokens, PII):

Kotlin
NetworkLoggerKmp.obfuscateLog { data ->
    data.copy(
        requestHeaders = data.requestHeaders.filterKeys { it != "Authorization" },
        requestBody = null  // or redact parts of the body
    )
}

The callback receives NetworkData and returns a modified NetworkData. The returned object is what gets sent to the native SDK.

Omit logs

Use NetworkLoggerKmp.omitLog to skip logging for certain requests (e.g. internal or health-check endpoints):

Kotlin
NetworkLoggerKmp.omitLog { data ->
    data.url.contains("/internal/") || data.url.contains("/health")
}

If the callback returns true, the network call is not logged.

Last updated