CLASS
SDKLogger
public class SDKLogger: LoggerProtocol
Default logger implementation for the SDK
Methods
init(subsystem:category:minLogLevel:maxLogEntries:)
public init(subsystem: String = "com.omniconvert.sdk",
category: String = "OmniconvertSDK",
minLogLevel: LogLevel = .info,
maxLogEntries: Int = 1000)
Initialize SDK logger - Parameters: - subsystem: The subsystem identifier - category: The category for logging - minLogLevel: Minimum log level to capture - maxLogEntries: Maximum number of log entries to keep in memory
Parameters
| Name | Description |
|---|---|
| subsystem | The subsystem identifier |
| category | The category for logging |
| minLogLevel | Minimum log level to capture |
| maxLogEntries | Maximum number of log entries to keep in memory |
debug(_:file:function:line:)
public func debug(_ message: String, file: String = #file, function: String = #function, line: Int = #line)
info(_:file:function:line:)
public func info(_ message: String, file: String = #file, function: String = #function, line: Int = #line)
warning(_:file:function:line:)
public func warning(_ message: String, file: String = #file, function: String = #function, line: Int = #line)
error(_:file:function:line:)
public func error(_ message: String, file: String = #file, function: String = #function, line: Int = #line)
log(level:message:file:function:line:)
public func log(level: LogLevel, message: String, file: String = #file, function: String = #function, line: Int = #line)
getAllLogEntries()
public func getAllLogEntries() -> [LogEntry]
Get all log entries - Returns: Array of log entries
getLogEntries(for:)
public func getLogEntries(for level: LogLevel) -> [LogEntry]
Get log entries for a specific level - Parameter level: The log level to filter by - Returns: Array of log entries for the specified level
Parameters
| Name | Description |
|---|---|
| level | The log level to filter by |
clearLogs()
public func clearLogs()
Clear all log entries
exportLogs()
public func exportLogs() -> String
Export logs as formatted string - Returns: Formatted string containing all log entries