Native Logging and Debugging
Dioxamine provides integrated logging channels that bridge JavaScript console messages and explicit log calls directly into the native Android Logcat stream.
Direct Native Logging (dioxamine.log)
The dioxamine.log namespace sends structured log entries to Android Logcat under the tag Plugin:<plugin-id>/<tag>.
Methods
dioxamine.log.v(tag: string, message: string): void // Verbose
dioxamine.log.d(tag: string, message: string): void // Debug
dioxamine.log.i(tag: string, message: string): void // Info
dioxamine.log.w(tag: string, message: string): void // Warn
dioxamine.log.e(tag: string, message: string): void // Error
Example
dioxamine.log.i("Network", "Connecting to device socket at 127.0.0.1:8080");
dioxamine.log.e("Sync", "File transfer aborted unexpectedly");
Automatic Console Hooking
Dioxamine automatically hooks standard JavaScript console methods:
console.log(...)-> Forwarded todioxamine.log.d()console.info(...)-> Forwarded todioxamine.log.i()console.warn(...)-> Forwarded todioxamine.log.w()console.error(...)-> Forwarded todioxamine.log.e()
Objects, errors, and arrays passed to console.log() are automatically serialized to JSON strings.
Inspecting Logs via ADB
You can monitor plugin runtime messages in real time using the ADB CLI from your PC:
adb logcat -s "Plugin:com.example.myplugin" "PluginJS:com.example.myplugin"
Chrome DevTools Remote Debugging
To inspect elements, view network requests, or set breakpoints using Chrome DevTools on your computer:
- Open Dioxamine on your phone.
- Navigate to Settings -> Plugins.
- Toggle Enable WebView Debugging on.
- On your PC, open Google Chrome and navigate to
chrome://inspect. - Under Remote Target, find your plugin WebView and click inspect.