Macro gstd::debug

source ·
macro_rules! debug {
    ($arg:literal) => { ... };
    ($arg:expr) => { ... };
    ($fmt:literal $(, $args:expr)+) => { ... };
Expand description

Add a debug message to the log.

Note that debug messages are available only if the program is compiled in debug mode.

cargo build --debug
cargo build --features=debug

You can see the debug messages when running the program using the gtest crate. To see these messages when executing the program on the node, you should run the node with the RUST_LOG="gwasm=debug" environment variable.


use gstd::debug;

extern "C" fn handle() {
    debug!("String literal");

    let value = 42;

    debug!("Formatted: value = {}", value);