Error logging

How to enable logging

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

Available logging options include:

ValueDescription
errorUsed for logging error messages.
warnUsed for logging warning messages.
infoUsed for logging informational messages.
debugUsed for logging debug messages.
verboseThe 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 28 lines
Last updated on