Skip to content

Commit b5fef8d

Browse files
added additional debug logs
1 parent 79923ba commit b5fef8d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

mParticle-Rokt-Swift/MPRoktLayout.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public class MPRoktLayout {
3333
confirmUser(attributes: attributes) { identifyCalled in
3434
let preparedAttributes = MPKitRokt.prepareAttributes(attributes, filteredUser: Optional<FilteredMParticleUser>.none, performMapping: true)
3535

36+
MPLog.debug("Initializing RoktLayout with arguments:", sdkTriggered.wrappedValue, viewName ?? "nil", locationName, preparedAttributes)
3637
self.roktLayout = RoktLayout.init(
3738
sdkTriggered: sdkTriggered,
3839
viewName: viewName,
@@ -43,6 +44,7 @@ public class MPRoktLayout {
4344
)
4445
// The Binding variable provided by the client allows us to trigger a re-render of the UI but we only want to do this if the value was true to start
4546
if identifyCalled && sdkTriggered.wrappedValue {
47+
MPLog.debug("Triggering Rokt Swift UI re-render")
4648
DispatchQueue.main.async {
4749
sdkTriggered.wrappedValue = false
4850
sdkTriggered.wrappedValue = true
@@ -84,10 +86,10 @@ public class MPRoktLayout {
8486
if emailMismatch || hashedEmailMismatch {
8587
// If there is an existing email or hashed email but it doesn't match what was passed in, warn the customer
8688
if emailMismatch {
87-
print("The existing email on the user (\(userEmailIdentity ?? "nil")) does not match the email passed in to `selectPlacements:` (\(email ?? "nil")). Please remember to sync the email identity to mParticle as soon as you receive it. We will now identify the user before creating the layout")
89+
MPLog.warning("The existing email on the user (\(userEmailIdentity ?? "nil")) does not match the email passed in to `selectPlacements:` (\(email ?? "nil")). Please remember to sync the email identity to mParticle as soon as you receive it. We will now identify the user before creating the layout")
8890
}
8991
if hashedEmailMismatch {
90-
print("The existing hashed email on the user (\(user.identities[hashedEmailIdentity ?? NSNumber(value: -1)] ?? "nil")) does not match the email passed in to `selectPlacements:` (\(hashedEmail ?? "nil")). Please remember to sync the hashed email identity to mParticle as soon as you receive it. We will now identify the user before creating the layout")
92+
MPLog.warning("The existing hashed email on the user (\(user.identities[hashedEmailIdentity ?? NSNumber(value: -1)] ?? "nil")) does not match the email passed in to `selectPlacements:` (\(hashedEmail ?? "nil")). Please remember to sync the hashed email identity to mParticle as soon as you receive it. We will now identify the user before creating the layout")
9193
}
9294

9395
syncIdentities(user: user, email: email, hashedEmail: hashedEmail, hashedEmailKey: hashedEmailIdentity) {
@@ -113,11 +115,11 @@ public class MPRoktLayout {
113115

114116
mparticle.identity.identify(identityRequest) {apiResult, error in
115117
if let error = error {
116-
print("Failed to sync email from selectPlacement to user: \(error)")
118+
MPLog.error("Failed to sync email from selectPlacement to user: \(error)")
117119
completion()
118120
} else {
119121
if let identities = apiResult?.user.identities {
120-
print("Updated user identity based off selectPlacement's attributes: \(identities)")
122+
MPLog.debug("Updated user identity based off selectPlacement's attributes: \(identities)")
121123
}
122124
completion()
123125
}

0 commit comments

Comments
 (0)