TelnyxLogCollector
public class TelnyxLogCollector
Collects debug logs during a call for inclusion in call reports
-
Undocumented
Declaration
Swift
public init(config: LogCollectorConfig = LogCollectorConfig())
-
Start capturing logs
Declaration
Swift
public func start() -
Stop capturing logs
Declaration
Swift
public func stop() -
Add a log entry if capturing is active and level passes filter
Declaration
Swift
public func addEntry(level: String, message: String, context: [String : Any]? = nil)Parameters
levelLog level (“debug”, “info”, “warn”, “error”)
messageLog message
contextOptional context dictionary
-
Get all collected logs (non-destructive)
Declaration
Swift
public func getLogs() -> [LogEntry]Return Value
Array of log entries
-
Atomically returns all logs and clears the buffer. Used by intermediate flushes so logs are not re-sent.
Declaration
Swift
public func drain() -> [LogEntry]Return Value
Array of log entries that were in the buffer
-
Get the number of collected logs
Declaration
Swift
public func getLogCount() -> IntReturn Value
Number of log entries in buffer
-
Clear the buffer
Declaration
Swift
public func clear() -
Check if collector is currently capturing
Declaration
Swift
public func isActive() -> BoolReturn Value
True if capturing, false otherwise
-
Check if collector is enabled
Declaration
Swift
public func isEnabled() -> BoolReturn Value
True if enabled, false otherwise