Internal debugging API
The Marine SDK has an internal feature called debug, it allows debugging some of the internal details of the IT execution.
Enabling debug API
To enable logging please specify the logger feature of the Marine SDK in Config.toml:
toml
toml
Using debug API
Normally, this feature should not be used by a backend developer. Below you can see examples of such details for the greeting service compiled with the debug feature. Please note, that it's necessary to run REPL with RUST_LOG.
sh
sh
The most important information these logs relates to the allocate/deallocate function calls. The sdk.allocate: 4 line corresponds to passing the 4-byte user string to the Wasm module, with the memory allocated inside the module, and the string is copied there. Whereas sdk.deallocate: 0x110080 8 refers to passing the 8-byte resulting string Hi, user to the host side. Since all arguments and results are passed by value, deallocate is called to delete unnecessary memory inside the Wasm module.