Home
/
UIKit
/
iOS

Logger

Sendbird UIKit 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 UIKit SDK and improve debug efficiency using our logging system.


Log types

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

TypeDescription

none

No logs recorded.

error

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

warn

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

info

Logs general events of UIKit.

all

Logs all detailed information of the events and activities, including info, warn, and error.


How to configure the log type

The default log type for iOS is none. You can set the log level through the setLogLevel() method in the SBUMain class. If you are developing your app in Swift, you can first set a single log type and use a logType array to specify all log types at once. In Objective-C, you can set a single log type and then use a bit mask to specify all log types at once.

Swift
Objective-C
Light Color Skin
Copy
// Output all logs.
SBUMain.setLogLevel(.all)
// Output only specific logs.
SBUMain.setLogLevel([.error, .info])
Light Color Skin
Copy
// Output all logs.
[SBUMain setLogLevel:LogTypeAll];
// Output only specific logs.
[SBUMain setLogLevel:LogTypeError|LogTypeInfo];

List of parameters

Parameter nameDescription

type

Type: LogType (enum)
Specifies one or more severity types of log to retrieve. You can select either a single or multiple log level types. Acceptable values are none, error, warn, info, and all.


Log format

Log messages as output are displayed on the console in the order as follows:

Light Color Skin
Copy
{date time} {tag} {type} {thread} {classFuncName} | {message}