This is an example plugin for the Soroban Debugger that demonstrates the plugin API.
- Logs all execution events to a file (
~/.soroban-debug/plugin-logs/example-logger.log) - Provides custom commands:
log-stats: Show logging statisticslog-path: Show the log file pathclear-log: Clear the log file
- Supports hot-reload
cd examples/plugins/example_logger
cargo build --release- Build the plugin (see above)
- Create the plugin directory:
mkdir -p ~/.soroban-debug/plugins/example-logger - Copy the plugin files:
cp target/release/libexample_logger_plugin.dylib ~/.soroban-debug/plugins/example-logger/ cp plugin.toml ~/.soroban-debug/plugins/example-logger/
Once installed, the plugin will automatically load when you run soroban-debug. It will log all execution events to the log file.
To disable plugins:
export SOROBAN_DEBUG_NO_PLUGINS=1
soroban-debug run --contract ./contract.wasm --function testThe log file contains timestamped entries for each event:
[1704067200] Plugin initialized. Logging to: "/Users/user/.soroban-debug/plugin-logs/example-logger.log"
[1704067201] BEFORE_CALL: test with args: Some("[]") (depth: 1)
[1704067201] AFTER_CALL: test - SUCCESS (duration: 125.45ms)
[1704067202] Plugin shutting down. Total events processed: 42