Skip to content

Commit

Permalink
Logging: added log when configuring SDK in observer mode (#2065)
Browse files Browse the repository at this point in the history
This is an important detail to log when initializing the SDK.
  • Loading branch information
NachoSoto authored Nov 23, 2022
1 parent d8457c5 commit c817f39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Logging/Strings/ConfigureStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ enum ConfigureStrings {

case store_kit_2_enabled

case observer_mode_enabled

case delegate_set

case purchase_instance_already_set
Expand Down Expand Up @@ -68,6 +70,8 @@ extension ConfigureStrings: CustomStringConvertible {
return "Debug logging enabled"
case .store_kit_2_enabled:
return "StoreKit 2 support enabled"
case .observer_mode_enabled:
return "Purchases is configured in observer mode"
case .delegate_set:
return "Delegate set"
case .purchase_instance_already_set:
Expand Down
3 changes: 3 additions & 0 deletions Sources/Purchasing/Purchases/Purchases.swift
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ public typealias StartPurchaseBlock = (@escaping PurchaseCompletedBlock) -> Void
if systemInfo.storeKit2Setting == .enabledForCompatibleDevices {
Logger.info(Strings.configure.store_kit_2_enabled, fileName: nil)
}
if systemInfo.observerMode {
Logger.debug(Strings.configure.observer_mode_enabled, fileName: nil)
}
Logger.debug(Strings.configure.sdk_version(Self.frameworkVersion), fileName: nil)
Logger.debug(Strings.configure.bundle_id(SystemInfo.bundleIdentifier), fileName: nil)
Logger.user(Strings.configure.initial_app_user_id(isSet: appUserID != nil), fileName: nil)
Expand Down

0 comments on commit c817f39

Please sign in to comment.