Skip to main content

SDK logs and debugging

SDK Logs

Available starting SDK 0.8.0

What are the SDK Logs?

The SDK logs is a zip file containning 3 kinds of file:

  • Bracelet logs: .txt file with technical informations coming from the firmware like commands received / sent, connection status, firmware actions
  • SDK logs: .txt file with technical informations coming from the SDK like the actions performed by the SDK, the BLE scan / communication
  • Sleep files: a copy of the .wiff files generated by the sleep sync and process

With these files the Cosano team will be able to investiguate any situation.

The log files available are today's and yesterday's only.

We will only be able investiguate a situation in this range

How to implement it

Here is how to add the export of the logs to your application:

val intent = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE)
val mainActivity = requireActivity() as MainActivity
mainActivity.startActivityForResult(intent) { a, b ->
b?.data?.also { uri ->
val docFile =
DocumentFile.fromTreeUri(requireContext(), uri)
?: return@startActivityForResult
CorsanoSdk.getLogs(requireContext(), docFile)
}
}
}

Extract of the file RecentDevicesFragment.kt of the Sample App

This will create a .zip file with all the technical information that we would need for the support.

Please send it to us to Mélanie Bortot's email: mbortot@mmt.ch

SDK debugging

Export the Realm database

The database content is very useful to debug. In Android studio it can be found: Device File Explorer > data > data > com.corsano.sdk.sample > .realm file