Error logging
How to enable logging
By default, when you initialize Swift Chat SDK, logging is disabled (LogLevel.off
).
Available logging options include:
Value | Description |
---|---|
error | Used for logging error messages. |
warn | Used for logging warning messages. |
info | Used for logging informational messages. |
debug | Used for logging debug messages. |
verbose | The most detailed level of logging. It includes everything at the debug level and more fine-grained information. |
To start log events, set LogLevel
to one of the above values by passing it in ChatConfiguration
.
1// Create PubNub configuration
2let pubNubConfiguration = PubNubConfiguration(
3 publishKey: "your-publish-key",
4 subscribeKey: "your-subscribe-key",
5 userId: "your-user-id"
6 // Add other required parameters
7)
8
9// Create Chat configuration
10let chatConfiguration = ChatConfiguration(
11 logLevel: .info
12)
13
14// Create ChatImpl instance
15let yourChat = ChatImpl(
show all 18 lines