Logging
ChatLoggerConfig - logging configuration model, controls detail level and output of diagnostic information.
Configuration
Logger configuration is passed during SDK initialization:
let chatCenterSdk = ChatCenterUISDK(
providerUid: "providerUid",
chatConfig: chatConfig,
loggerConfig: ChatLoggerConfig(logLevel: .all)
)
Log Levels
| Level | Description | Usage |
|---|---|---|
.none | Logging disabled | Production builds |
.error | Errors only | Production builds with minimal diagnostics |
.warning | Warnings and errors | Pre-production testing |
.info | General information + warnings + errors | Development |
.debug | Detailed information for debugging | Development and integration |
.all | All messages including trace | Diagnostics and bug reporting |
Recommendations
- Development: Use
.allor.debugfor full information - Testing:
.infoor.warningto catch important events - Production:
.erroror.noneto minimize performance impact - Bug reporting: Always include logs with
.alllevel when contacting support
Usage Example
// Development - all logs
let devLogger = ChatLoggerConfig(logLevel: .all)
// Production - errors only
let prodLogger = ChatLoggerConfig(logLevel: .error)
// Initialization with logger
let chatCenterSdk = ChatCenterUISDK(
providerUid: "providerUid",
chatConfig: chatConfig,
loggerConfig: devLogger
)
note
Logs can be viewed in Xcode console during debugging. For production builds, consider integrating with your analytics system to collect crash reports and errors.