pub fn init_logger(
callback: Option<Arc<dyn LogCallback>>,
level: Option<LogLevel>,
)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 log level. Defaults toInfoif not specified. Can be overridden byRUST_LOGenvironment variable at runtime or compile time.
§Example
// Initialize with callback and trace-level logging before creating clients
initLogger(FlightRecorderCallback(), LogLevel.TRACE)
val client = Client(tokenProvider, settings)§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
- Platform loggers (oslog/logcat) are always enabled regardless of callback