11package com.mparticle.react.rokt
22
3- import android.util.Log
43import com.facebook.react.bridge.ReactApplicationContext
54import com.facebook.react.bridge.ReactMethod
65import com.facebook.react.bridge.ReadableMap
@@ -11,6 +10,7 @@ import com.mparticle.MParticle
1110import com.mparticle.WrapperSdk
1211import com.mparticle.react.NativeMPRoktSpec
1312import com.mparticle.rokt.RoktEmbeddedView
13+ import com.mparticle.internal.Logger
1414import java.lang.ref.WeakReference
1515import java.util.concurrent.CountDownLatch
1616
@@ -21,10 +21,6 @@ class MPRoktModule(
2121 MParticle .getInstance()?.setWrapperSdk(WrapperSdk .WrapperSdkReactNative , " " )
2222 }
2323
24- companion object {
25- private const val TAG = " MPRoktModule"
26- }
27-
2824 private val impl = MPRoktModuleImpl (reactContext)
2925
3026 override fun getName (): String = impl.getName()
@@ -38,7 +34,7 @@ class MPRoktModule(
3834 fontFilesMap : ReadableMap ? ,
3935 ) {
4036 if (identifier.isBlank()) {
41- Log .w( TAG , " selectPlacements failed. identifier cannot be empty" )
37+ Logger .warning( " selectPlacements failed. identifier cannot be empty" )
4238 return
4339 }
4440 MParticle .getInstance()?.Rokt ()?.events(identifier)?.let {
@@ -85,7 +81,7 @@ class MPRoktModule(
8581 placeholders.getDouble(key).toInt()
8682
8783 else -> {
88- Log .w( TAG , " Invalid view tag for key: $key " )
84+ Logger .warning( " Invalid view tag for key: $key " )
8985 continue
9086 }
9187 }
@@ -94,20 +90,20 @@ class MPRoktModule(
9490 val uiManager =
9591 UIManagerHelper .getUIManagerForReactTag(reactContext, reactTag)
9692 if (uiManager == null ) {
97- Log .w( TAG , " UIManager not found for tag: $reactTag " )
93+ Logger .warning( " UIManager not found for tag: $reactTag " )
9894 continue
9995 }
10096
10197 // Resolve the view using the manager (now on UI thread)
10298 val view = uiManager.resolveView(reactTag)
10399 if (view is RoktEmbeddedView ) {
104100 placeholdersMap[key] = WeakReference (view)
105- Log .d( TAG , " Successfully found Widget for key: $key with tag: $reactTag " )
101+ Logger .debug( " Successfully found Widget for key: $key with tag: $reactTag " )
106102 } else {
107- Log .w( TAG , " View with tag $reactTag is not a Widget: ${view?.javaClass?.simpleName} " )
103+ Logger .warning( " View with tag $reactTag is not a Widget: ${view?.javaClass?.simpleName} " )
108104 }
109105 } catch (e: Exception ) {
110- Log .w( TAG , " Error processing placeholder for key $key : ${e.message} " )
106+ Logger .warning( " Error processing placeholder for key $key : ${e.message} " )
111107 e.printStackTrace()
112108 }
113109 }
@@ -120,7 +116,7 @@ class MPRoktModule(
120116 // Wait for UI thread to finish processing
121117 latch.await()
122118 } catch (e: InterruptedException ) {
123- Log .w( TAG , " Interrupted while waiting for UI thread: ${e.message} " )
119+ Logger .warning( " Interrupted while waiting for UI thread: ${e.message} " )
124120 }
125121 }
126122
0 commit comments