Logging and Debugging
This section shows a simple pattern for viewing and sharing logs.
How logging works
Bubbl exposes a Logger helper that writes logs to a file.
Logger.log("MainActivity", "Manual refresh")
Sharing logs
You can share logs using FileProvider.
val logFile = Logger.getLogFile()
val uri = FileProvider.getUriForFile(this, "${packageName}.fileprovider", logFile)
Required file_paths.xml
If 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.