Skip to content
Last updated

Logging and Debugging

The host app exposes a log viewer and a “Share logs” button.

How logging worksBubbl exposes a Logger helper that writes logs to a file.

Logger.log("MainActivity", "Manual refresh")

Sharing logsThe host app shares logs using FileProvider.

val logFile = Logger.getLogFile()
val uri = FileProvider.getUriForFile(this, "${packageName}.fileprovider", logFile)

Required file_paths.xmlIf you want to share logs, add this file:

app/src/main/res/xml/file_paths.xml

<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <files-path name="logs" path="." />
</paths>

Why

Without this file, FileProvider cannot generate a shareable URI and will crash.

Tip

If you do not need log sharing in production, remove the FileProvider and the related permissions.