Page tree

PubMatic iOS SDK provides a logging feature you can use to debug your ads from PubMatic or to get more information about the ad flow. Enable these features by setting an appropriate log level for PubMaticSDK.

SDK Log Levels

Here is how you can set a log level for PubMaticSDK:

Step 1

Include PubMaticSDK.h the header file: 

Include the PubMaticSDK.h File
#import "PubMaticSDK.h"

Step 2

Set a log level in PubMaticSDK.h:

Set a Log Level
[PubMaticSDK setLogLevel:<#PMLogLevel#>];
Default log level is PMLogLevelWarn.

There are five log priority levels:

  1. PMLogLevelNone —No logs at all
  2. PMLogLevelError
  3. PMLogLevelWarn
  4. PMLogLevelInfo
  5. PMLogLevelDebug—All logs

When you set a log level for PubMaticSDK, you'll see all the logs having priority greater than or equal to the set log level; for example, the default log level PMLogLevelWarn enables only warning and error logs in the SDK.

All logs are disabled automatically in Release mode.

SDK Error Codes

PubMatic SDK gives delegate callbacks on failure of ad loading in multiple cases. These delegate callbacks receive a parameter of type PMError, subclass of NSError. It describes the reason for failure. It has an error-code and localized error-message describing the error event. Please refer the below table for details about the possible error codes and its description.

Sr. No.Error TypeError CodeDescription of Error
1INVALID_REQUEST1001Invalid request. May be missing mandatory parameter in request.
2NO_ADS_AVAILABLE1002No ads to show
3NETWORK_ERROR1003There was an error loading data from the network.
4SERVER_ERROR1004The ad server experienced a failure processing the request.
5OS_VERSION_TOO_LOW1005The current device’s OS is below the minimum required version.
6TIMEOUT_ERROR1006Ad request timed out
7INTERSTITIAL_ALREADY_USED1007Will not send request because the interstitial object has already been used.
8INTERNAL_ERROR1008Internal error
9INVALID_RESPONSE1009Invalid ad response
10REQUEST_CANCELLED1013Ad request gets cancelled
11RENDER_ERROR1014Issue in rendering creative

⇧ Top