mavryk-smart-rollup-debug

Crates.iomavryk-smart-rollup-debug
lib.rsmavryk-smart-rollup-debug
version0.2.2
created_at2024-07-30 09:43:38.199563+00
updated_at2024-07-30 09:43:38.199563+00
descriptionOutput formatted messages to Mavryk Smart Rollup debug log.
homepage
repositoryhttps://gitlab.com/mavryk-network/mavryk-protocol.git
max_upload_size
id1319611
size5,498
Tristan Allaire (TristanAllaire)

documentation

README

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");
}
Commit count: 0

cargo fmt