Debugging

Debugging

The Sensibill SDK uses the OSLog framework for logging. All Sensibill SDK log statements use SBL-prefixed categories to be identifiable. The category will appear in front of the log message in with the format [SBL...] and can be used to filter specific messages.

The following categories are provided:

  • SBLNet for error and debug messages related to networking
  • SBLCapture for error and debug messages related to Sensibill Capture
  • SBLError for all other SDK error messages
  • SBLSDK for all other SDK debug statements

Example:

The following snippet shows the appearance of various log messages in the XCode Console.

2021-01-13 12:08:18.263416-0500 YourApp[1234:5678901] [SBLSDK] Sensibill:start
...
2021-01-13 12:08:18.263703-0500 YourApp[1234:5678901] [SBLNet] Certificates for pinning were loaded from main bundle
...
2021-01-13 12:08:18.264000-0500 YourApp[1234:5678901] [SBLError] SensibillError=1001: Error Domain=<...>

Sensibill Errors

When the SDK generates an error it returns a SensibillError type and logs the code of the returned error using the SBLError category with the format SensibillError=..., followed by additional information.

The additional information provides details about the cause and/or source of the error. It may include:

  • The domain, code, and message (if available) of the error received from the underlying framework.
  • The name, code, message, and correlationID of the error returned by the Sensibill API. The last field - correlationID - allows Sensibill support to find the matching operation in the server side logs.

Note: when viewing the log in the Console app outside of XCode, any additional information about the error that may contain sensitive data is stripped.

Example:

The following example demonstrates a situation where an error with the code 1063 is generated by the SDK. As the additional information shows, the log was generated when an error with the domain NSURLErrorDomain and code 2 was received by the SDK from the one of the underlying frameworks.

2021-01-13 12:08:18.265700-0500 YourApp[1234:5678901] [SBLError] SensibillError=1063: Error Domain=NSURLErrorDomain Code=2 "(null)"