LoggingInterceptor

class LoggingInterceptor : Interceptor

OkHttp interceptor that logs each HTTP request/response in a multi-section block matching the iOS HTTPClient format exactly:

------- 🟢 /path ------- [Success]
--- Request
[METHOD] url
--- Headers
"key": "value", ...
--- Body
{ pretty-printed request body or n/a }
--- Response [200]
{ pretty-printed response body }

Or on failure (HTTP 4xx/5xx or network exception):

------- 🔴 /path ------- [Failure]
--- Request
--- Headers
--- Body
--- Error
<exception or status code>

Visibility: emits at LogLevelEnum.DEBUG for success, ERROR for failure. In customer production builds (cloud + verboseLogging off + forceVerboseLogs off), DEBUG is filtered out — only failed requests reach device logs. The full payload becomes visible when _setVerboseLogs(true) SPI is called or the local-build WHERE_AM_I = LOCAL flag is set, matching the iOS HTTPClient gating model.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun intercept(chain: Interceptor.Chain): Response