Logger
Calls SDK for iOS offers a logging system that allows you to keep track of a number of events and activities while running your app. You can closely monitor the operation of the Calls SDK and improve debug efficiency using our log system.
SBCLogger class
To display log output to the console, implement SBCLogger.setLoggerLevel()
as shown below:
Log levels
Log levels can be used to control log outputs. If logging is enabled at the specified log level, it also enables logging at all higher levels. The priority level of logs are in the following order: info (0) < warning (1) < error (2) < none (3).
Level | Description |
---|---|
info | Logs that track the general events of the Calls SDK. |
warning | Logs that indicate potentially problematic situations. |
error | Logs that represent the failure of the Calls SDK execution. |
none (default) | Not used for writing log outputs. |
Note: Calls SDKs for iOS and JavaScript share the same order for the priority level of logs.
Log format
The log output is written in the following format: {date time} {prefix} {type} {thread} {classFuncName} | {message}
.
Methods
This class provides the following methods:
Name | Description |
---|---|
setLoggerLevel(_:) | Determines the log level which type of logs are displayed to the console and delivered to custom log receivers. |
add(receiver:) | Adds a custom log receiver to the |
remove(receiver:) | Removes a custom log receiver from the |
SBCLogReceiver protocol
If you want to display log outputs in other tools such as device logs, console.app
, or on your server, implement the SBCLogReceiver
protocol to your custom log class as shown below.