#mavryk #rollup #debugging #debugging-logging #no-alloc #api-bindings #smart

no-std mavryk-smart-rollup-debug

Output formatted messages to Mavryk Smart Rollup debug log

1 unstable release

0.2.2 Jul 30, 2024

#451 in WebAssembly


Used in 3 crates

MIT license

115KB
2K SLoC

Provides debug log which can be written to, but does not affect the host state.

The result of writing to the debug log is implementation specific - it may, for example, be written to a log file, or to stdout etc.

The debug_msg macro supports inline formatting:

extern crate alloc;
use mavryk_smart_rollup_debug::debug_msg;
use mavryk_smart_rollup_host::runtime::Runtime;

fn log_runtime(host: &impl Runtime) {
  debug_msg!(host, "Simple constant string");

  debug_msg!(host, "A format {} with argument {}", "test", 5);
}

In the simplest case, however, one can also write:

use mavryk_smart_rollup_host::runtime::Runtime;

fn log_simple(host: &impl Runtime) {
    host.write_debug("A simple constant string");
}

lib.rs:

Provides debug log which can be written to, but does not affect the host state.

The result of writing to the debug log is implementation specific - it may, for example, be written to a log file, or to stdout etc.

Dependencies

~0–0.8MB
~16K SLoC