Skip to content

Commit

Permalink
feat: write swift and kotlin log events to file
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasonvdb committed Apr 17, 2024
1 parent 2c89a29 commit a5d2f9c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/android/src/main/java/com/reactnativeldk/LdkModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1440,5 +1440,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

0 comments on commit a5d2f9c

Please sign in to comment.