mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2025-12-18 22:44:22 +01:00
* Add SDK global logger * Add bindings * Fix path to internal uniffi log * Exclude "set_log_stream" from generated RN methods * Move logger-specific structs to a separate module * Delegate init_logging to method in logger.rs * Rename uniffi BindingLogger to UniffiBindingLogger * Add set_log_stream for dart bindings * Add SDK logger to Dart bindings * Rename dart binding logger to DartBindingLogger * Add rustdocs * RN bindings: Add manual handling for setLogStream() * Re-generate dart bindings * Re-generate RN bindings * Remove LOG_INIT cell * Set global maximum log level once on initialization Return a LiquidSdkError::Generic instead of Anyhow error when initializing log stream on Dart bindings * Do not panic when initializing binding loggers * Rename LogStream to Logger --------- Co-authored-by: Erdem Yerebasmaz <erdem@yerebasmaz.com>
13 lines
410 B
Plaintext
13 lines
410 B
Plaintext
import Foundation
|
|
import BreezLiquidSDK
|
|
|
|
class BreezLiquidSDKLogger: Logger {
|
|
static let emitterName: String = "breezLiquidSdkLog"
|
|
|
|
func log(l: LogEntry) {
|
|
if RNBreezLiquidSDK.hasListeners {
|
|
RNBreezLiquidSDK.emitter.sendEvent(withName: BreezLiquidSDKLogger.emitterName,
|
|
body: BreezLiquidSDKMapper.dictionaryOf(logEntry: l))
|
|
}
|
|
}
|
|
} |