iOS - Debug Mode

Debug mode allows you to view debug logs for the Pilgrim SDK so you can quickly spot any configuration errors and better understand SDK states. For iOS, there is a method named presentDebugViewController(parentViewController:) in the PilgrimManager that will present a view controller from your current view controller with the debug logs you can display in your host app. Developers who wish to display debug mode can do so with the following implementation instructions:

1. Configure Pilgrim

You should have already configured Pilgrim in your application’s AppDelegate (if not, see this).

2. Enable Debugging in AppDelegate

In the didFinishLaunchingWithOptions method where you configured the Pilgrim Manager, add the following line of code:

PilgrimManager.shared().isDebugLogsEnabled = true

This will begin logging and saving debug statements that will be displayed in debug mode.

3. Present the Debug View Controller

The presentDebugViewController(parentViewController:) method returns a view containing debug mode. You can choose how you’d like to display this (e.g., through a button, a gesture, etc.). Here is an example of how to initialize and present it:

PilgrimManager.shared().presentDebugViewController(parentViewController: self)