setLogSink

Routes SDK log output to sink instead of the built-in default (Android logcat on Android, standard output on the JVM).

The sink is global: it receives the output of every TrustPin instance, each message carrying the producing instance's id. Log filtering remains per instance via TrustPin.setLogLevel — a sink never receives messages that the instance's level suppressed.

TrustPin.setLogSink { level, instanceId, message ->
Timber.tag("TrustPin/$instanceId").log(level.toTimberPriority(), message)
}

Parameters

sink

The destination for SDK log output, or null to restore the built-in default. See TrustPinLogSink for the thread-safety and non-blocking requirements implementations must meet.