Macro gstd::debug

source ·
macro_rules! debug {
    ($($arg:tt)*) => { ... };
}
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.

§Examples

use gstd::debug;

#[no_mangle]
extern "C" fn handle() {
    debug!("String literal");

    let value = 42;
    debug!("{value}");

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