Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/android/src/main/java/com/reactnativeldk/LdkModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
}
Expand Down Expand Up @@ -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")
}
}
}
4 changes: 4 additions & 0 deletions lib/ios/Ldk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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] {
Expand Down