Skip to main content
Version: 2.2

Logs

SDK has an internal logging system to help with debugging and solving issues. SDK logs are stored in their own files along with other files used by the SDK. To see more or less SkyPath logs in the app console you can change the logging level. By default, it is set to LoggingLevel.error to see only critical logs. More verbose levels can be needed only to debug the issue, otherwise, it is fine to have just a default value.

SkyPath.shared.logger.level = .error

The SDK rolls out the logs files to keep only fresh ones and does not take a lot of disk size. Configuration set to default values. rollingFrequency is checked on every log message, so a new file will be created immediately after time passed and old files will be deleted at the same time according to maximumNumberOfLogFiles.

SkyPath.shared.logger.rollingFrequency = 604_800
SkyPath.shared.logger.maximumNumberOfLogFiles = 4

You can also disable logging completely and SDK will not write any logging information, however in this case it will be complex to debug any possible issues with the integration, so strongly discouraged.

SkyPath.shared.logger.enabled = false

Logs help to identify the issue, so files can be exported and then sent to the SkyPath team. By the following API, you can get the logs file URL. You can for example upload it to your own issues tracking system and then inform the SkyPath team.

SkyPath.shared.logger.exportLogs { fileUrl, error in
// fileUrl of a file created in the temporary directory or an error if exporting failed
}