Debugging

View and understand Purchases logs

👍

This section assumes you've followed our Quickstart section of our Getting Started guide to install and configure our SDK.

Debugging

Purchases will log important information and errors to help you understand what is going on behind the scenes. You can enable more detailed debug logs with the debugLogsEnabled flag. You can set this immediately in your app while testing, before you configure Purchases.

Purchases.logLevel = .debug
Purchases.configure(withAPIKey: "public_sdk_key", appUserID: "my_app_user_id")
RCPurchases.logLevel = RCLogLevelDebug;
[RCPurchases configureWithAPIKey:@"public_sdk_key" appUserID:@"my_app_user_id"];
Purchases.debugLogsEnabled = true
Purchases.configure(this, "public_sdk_key", "my_app_user_id")
Purchases.setDebugLogsEnabled(true);
Purchases.configure(this, "public_sdk_key", "my_app_user_id");
Purchases.setDebugLogsEnabled(true);
Purchases.setup("public_sdk_key", "my_app_user_id");
await Purchases.setDebugLogsEnabled(true);
await Purchases.setup("public_sdk_key", "my_app_user_id");
Purchases.SetDebugLogsEnabled(true);

📘

OS_ACTIVITY_MODE and Common iOS Issues

On iOS, disabling OS_ACTIVITY_MODE in your Xcode scheme will block debug logs from printing in the console. If you have debug logs enabled, but don't see any output, go to Product -> Scheme -> Edit Scheme... in Xcode and uncheck the OS_ACTIVITY_MODE environment variable.

Flutter projects using Swift may fail to show debug logs in the console if you are using Visual Studio Code, Android Studio, or other IDE's to run your project. We recommend running your Flutter project using Xcode to view debug logs from the Purchases SDK.

Filtering Purchases Logs

All logs from Purchases SDK are prepended with "[Purchases]", you can use this string as a filter in your log output to clearly see the logs that are from Purchases.

Debug Logs Legend

Emojis currently available on the following platforms:

  • Android version >= 4.0.2
  • iOS version >= 3.10.1
    Support for other platforms coming soon.
Icon(s)Log LevelDescriptionRequired Actions
🍎 :bangbang:Error
Warn
Error/warning messages generated from AppleView error handling doc if on Error level
🤖 :bangbang:Error
Warn
Error/warning messages generated from GoogleView error handling doc if on Error level
đŸ˜ŋ :bangbang:ErrorError messages generated from RevenueCatView error handling doc
đŸ˜ģDebugSuccess messages generated from RevenueCatNo action required, for informational purposes.
đŸ˜ģ💰InfoRevenueCat received purchase informationNo action required, for informational purposes.
💰DebugMessages related to your productsNo action required, for informational purposes.
ℹī¸Debug
Info
Messages detailing events that occur in your app cycleNo action required, for informational purposes.
👤DebugMessages related to a user's App User IDNo action required, for informational purposes.
:warning:WarnWarning messages about implementationView log message for additional information.

Messages that have the double red exclamation marks prefix (:bangbang:) attached provides important information regarding your implementation and may require your attention. Paying attention to the source of the message will assist you during the development process. Be sure to address these logs before shipping your app.

Sample Output

Below are sample logs generated when setting debugLogsEnabled = true. Keep an eye out for any ERROR level logs, status codes other than 200, or any Invalid Product Identifiers.

[Purchases] - DEBUG: Debug logging enabled.
[Purchases] - DEBUG: SDK Version - 2.0.0
[Purchases] - DEBUG: Initial App User ID - <APP_USER_ID>
[Purchases] - DEBUG: Changing App User ID: (null) -> <APP_USER_ID>
[Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID>
[Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID>/products
[Purchases] - DEBUG: Delegate set
[Purchases] - DEBUG: Sending latest purchaser info to delegate
[Purchases] - DEBUG: Vending purchaserInfo from cache
[Purchases] - DEBUG: Vending purchaserInfo from cache
[Purchases] - DEBUG: applicationDidBecomeActive
[Purchases] - DEBUG: No cached entitlements, fetching
[Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID> 200
[Purchases] - DEBUG: Purchaser info updated, sending to delegate
[Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID>/products 200
[Purchases] - DEBUG: Requesting products with identifiers: {(
    onetime,
    annual,
    onemonth
)}
[Purchases] - DEBUG: Products request finished
[Purchases] - DEBUG: Valid Products:
[Purchases] - DEBUG: annual - <SKProduct: 0x600000308980>
[Purchases] - DEBUG: onemonth - <SKProduct: 0x6000003131b0>
[Purchases] - DEBUG: onetime - <SKProduct: 0x600000313180>
[Purchases] - DEBUG: Invalid Product Identifiers - (
)
[Purchases] - DEBUG: 2 completion handlers waiting on products
[Purchases] - DEBUG: makePurchase - onemonth
[Purchases] - DEBUG: PaymentQueue updatedTransaction: onemonth (null) ((null)) - 0
[Purchases] - DEBUG: PaymentQueue updatedTransaction: onemonth <TRANSACTION_ID> ((null)) - 2
[Purchases] - DEBUG: Finishing onemonth <TRANSACTION_ID> ((null))
[Purchases] - DEBUG: PaymentQueue removedTransaction: onemonth <TRANSACTION_ID> ((null)) - 2
[Purchases] - DEBUG: ℹī¸ Debug logging enabled
[Purchases] - DEBUG: ℹī¸ SDK Version - 3.10.1
[Purchases] - DEBUG: 👤 Initial App User ID - <APP_USER_ID>
[Purchases] - DEBUG: ℹī¸ PurchaserInfo cache is stale, updating caches
[Purchases] - DEBUG: ℹī¸ Offerings cache is stale, updating caches
[Purchases] - DEBUG: ℹī¸ Vending PurchaserInfo from cache.
[Purchases] - DEBUG: ℹī¸ There are no requests currently running, starting request GET /subscribers/<APP_UESR_ID>
[Purchases] - DEBUG: ℹī¸ API request started: GET /v1/subscribers/<APP_UESR_ID>
[Purchases] - DEBUG: ℹī¸ API request started: GET /v1/subscribers/<APP_UESR_ID>/offerings
[Purchases] - DEBUG: ℹī¸ No cached Offerings, fetching from network
[Purchases] - DEBUG: ℹī¸ API request completed with status: GET /v1/subscribers/<APP_UESR_ID>/offerings 200
[Purchases] - DEBUG: ℹī¸ Requesting products from the store with identifiers: {(
    onetime,
    annual,
    onemonth
)}
[Purchases] - DEBUG: ℹī¸ Products request finished.
[Purchases] - DEBUG: 💰 Retrieved SKProducts: 
[Purchases] - DEBUG: 💰 onetime - <SKProduct: 0x600000308980>
[Purchases] - DEBUG: 💰 annual - <SKProduct: 0x600000308980>
[Purchases] - DEBUG: 💰 onemonth - <SKProduct: 0x600000308980>
[Purchases] - WARN: 🍎â€ŧī¸ Invalid Product Identifiers - (
)
[Purchases] - DEBUG: ℹī¸ 3 completion handlers waiting on products
[Purchases] - DEBUG: ℹī¸ makePurchase
[Purchases] - DEBUG: 💰 Purchasing product from package  - annual in Offering main
[Purchases] - DEBUG: ℹī¸ PaymentQueue updatedTransaction: annual <TRANSACTION_ID> ((null)) (null) - 0

[Purchases] - DEBUG: 💰 Finishing transaction annual <TRANSACTION_ID> ((null))
[Purchases] - DEBUG: ℹī¸ PaymentQueue removedTransaction: annual <TRANSACTION_ID> (null (null)) (null) - 1

Next Steps