Skip to main content
Version: Next

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

LevelDescriptionUsage
.noneLogging disabledProduction builds
.errorErrors onlyProduction builds with minimal diagnostics
.warningWarnings and errorsPre-production testing
.infoGeneral information + warnings + errorsDevelopment
.debugDetailed information for debuggingDevelopment and integration
.allAll messages including traceDiagnostics and bug reporting

Recommendations

  • Development: Use .all or .debug for full information
  • Testing: .info or .warning to catch important events
  • Production: .error or .none to minimize performance impact
  • Bug reporting: Always include logs with .all level 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.