pub fn init_logger(
callback: Option<Arc<dyn LogCallback>>,
level: Option<LogLevel>,
platform_logger: bool,
)Expand description
Initialize the SDK logger
This function should be called once before creating any SDK clients. It initializes the tracing infrastructure for the SDK and optionally registers a callback to receive log events.
§Parameters
callback: Optional callback to receive SDK log events. PassNoneto use only platform loggers (oslog on iOS, logcat on Android).level: Optional minimum log level; events below it are dropped. Defaults toInfoif not specified. Can be overridden by theRUST_LOGenvironment variable at runtime or compile time.platform_logger: Whether the SDK writes log events to the platform logger (oslog on iOS, logcat on Android, stdout elsewhere). Defaults totrue. Disable it whencallbackalready forwards events there, otherwise every event is logged twice.
§Example
// Initialize with callback and trace-level logging before creating clients
initLogger(FlightRecorderCallback(), LogLevel.TRACE)
val client = Client(tokenProvider, settings, ManagedSettingsBindingClient())§Notes
- This function can only be called once - subsequent calls are ignored
- If not called explicitly, logging is auto-initialized when first client is created