Chat SDKs iOS v3
Chat SDKs iOS
Chat SDKs
iOS
Version 3
Sendbird Chat SDK v3 for iOS is no longer supported as a new version is released. Check out our latest Chat SDK v4

Logger

Copy link

Sendbird Chat SDK for iOS offers a logging system that allows you to keep track of a number of events and activities, including data flow, error, and information while running your application. You can closely monitor the operation of the Sendbird SDK and improve debug efficiency using our logging system.


Log types

Copy link

Log types, or log levels, can be used to categorize and control log outputs. The following table lists four different log types for the logger in Sendbird Chat SDK for iOS.

List of log types

Copy link
TypeDescription

none

No logs recorded.

error

Logs what have caused failures in the specific events, but not an SDK-wide failure.

warn

Logs unexpected events which wouldn’t affect the operation of Chat SDK, but might cause problems.

info

Logs general events of Chat SDK.


How to configure the log type

Copy link

The default log type set for Sendbird Chat SDK for iOS is SBDLogLevelWarning, which means that Sendbird SDK will keep logs of warning messages. You can change the settings through the setLoggerLevel() method in the SBDMain class as follows:

SwiftObjective-C
SBDMain.setLogLevel([.error, .info])

List of parameters

Copy link
Parameter nameTypeDescription

level

SBDLogLevel

Specifies the severity level of log to retrieve. One takes precedence over the other in the order of SBDLogLevelNone, SBDLogLevelError, SBDLogLevelWarning, and SBDLogLevelInfo.


Log filtering

Copy link

All Sendbird Chat SDK log messages are tagged with [Sendbird]. If you want to see the log messages from Sendbird Chat SDK, search for the messages with a keyword [Sendbird].

The following logs show how to read Sendbird Chat SDK logs.

#[Sendbird](LOG_LEVEL)-[FILE_NAME:LINE_NUMBER] LOG_MESSAGE
2021-01-08 08:17:27.179097-0800 SendBirdSDKApplication[73884:2580607] [Sendbird](I)-[SBDWebSocketClient.m:306] webSocket:didCloseWithCode:reason:wasClean:
2021-01-08 08:17:27.206567-0800 SendBirdSDKApplication[73884:2580607] [Sendbird](E)-[SBDWebSocketClient.m:190] quit() with error: (null)
2021-01-08 08:17:27.216912-0800 SendBirdSDKApplication[73884:2580607] [Sendbird](I)-[SBDWebSocketClient.m:140] Stop Pinger.
2021-01-08 08:17:27.227669-0800 SendBirdSDKApplication[73884:2580607] [Sendbird](I)-[SBDWebSocketClient.m:116] Stop Watchdog.
2021-01-08 08:17:27.228149-0800 SendBirdSDKApplication[73884:2580607] [Sendbird](I)-[SBDMain.m:810] WS Close.