diff --git a/lib/android/src/main/java/com/reactnativeldk/LdkModule.kt b/lib/android/src/main/java/com/reactnativeldk/LdkModule.kt index a371d195..ccd1cc93 100644 --- a/lib/android/src/main/java/com/reactnativeldk/LdkModule.kt +++ b/lib/android/src/main/java/com/reactnativeldk/LdkModule.kt @@ -1195,6 +1195,8 @@ class LdkModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMod if (res.is_ok) { txs.pushHexString((res as Result_TransactionNoneZ.Result_TransactionNoneZ_OK).res) + } else { + LdkEventEmitter.send(EventTypes.native_log, "Failed to spend outputs for channel $channelId") } } } @@ -1440,5 +1442,9 @@ object LdkEventEmitter { } this.reactContext!!.getJSModule(RCTDeviceEventEmitter::class.java).emit(eventType.toString(), body) + + if (eventType == EventTypes.native_log) { + LogFile.write("DEBUG (KOTLIN): $body") + } } } diff --git a/lib/ios/Ldk.swift b/lib/ios/Ldk.swift index acb2618a..feb81fa1 100644 --- a/lib/ios/Ldk.swift +++ b/lib/ios/Ldk.swift @@ -1550,6 +1550,10 @@ class LdkEventEmitter: RCTEventEmitter { public func send(withEvent eventType: EventTypes, body: Any) { //TODO convert all bytes to hex here sendEvent(withName: eventType.rawValue, body: body) + + if eventType == .native_log { + Logfile.log.write("DEBUG (SWIFT): \(body)") + } } override func supportedEvents() -> [String] {