From ca5085c10656b47668b89250f4a072e05f01d22e Mon Sep 17 00:00:00 2001 From: Mikolaj Date: Mon, 20 Nov 2023 16:02:17 +0100 Subject: [PATCH] Add logger --- ios/MembraneWebRTC.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ios/MembraneWebRTC.swift b/ios/MembraneWebRTC.swift index 25e7d89f..542f23a9 100644 --- a/ios/MembraneWebRTC.swift +++ b/ios/MembraneWebRTC.swift @@ -6,7 +6,8 @@ import AVKit import WebRTC import ExpoModulesCore -let log = OSLog(subsystem: "com.example.app", category: "MyLogger") +let log = OSLog(subsystem: "com.swm.membranewebrtc", category: "ErrorHandling") + #if os(iOS) @available(iOS 12, *) public extension RPSystemBroadcastPickerView { @@ -231,7 +232,7 @@ class MembraneWebRTC: MembraneRTCDelegate { membraneRTC?.receiveMediaEvent(mediaEvent: data as SerializedMediaEvent) } - + func connect(metadata: [String: Any], promise: Promise) { connectPromise = promise localUserMetadata = metadata.toMetadata() @@ -418,7 +419,7 @@ class MembraneWebRTC: MembraneRTCDelegate { try setScreencastTrackState(isEnabled: true) } catch{ - print("Error starting screencast: \(error)") + os_log("Error starting screencast: \(error)", log: log, type: .error) } }, onStop: { [weak self] in @@ -432,7 +433,7 @@ class MembraneWebRTC: MembraneRTCDelegate { try setScreencastTrackState(isEnabled: false) } catch{ - print("Error stoping screencast: \(error)") + os_log("Error starting screencast: \(error)", log: log, type: .error) } }) DispatchQueue.main.async {