Error logging

How to enable logging

By default, when you initialize Swift Chat SDK, logging is disabled (LogLevel.off).

Available logging options include:

ValueDescription
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.

// Create PubNub configuration
let pubNubConfiguration = PubNubConfiguration(
publishKey: "your-publish-key",
subscribeKey: "your-subscribe-key",
userId: "your-user-id"
// Add other required parameters
)

// Create Chat configuration
let chatConfiguration = ChatConfiguration(
logLevel: .info
)

// Create ChatImpl instance
let yourChat = ChatImpl(
show all 18 lines
Last updated on