tezos-smart-rollup-debug

Crates.iotezos-smart-rollup-debug
lib.rstezos-smart-rollup-debug
version0.2.2
sourcesrc
created_at2023-04-25 14:05:09.156659
updated_at2023-11-24 18:14:26.091038
descriptionOutput formatted messages to Tezos Smart Rollup debug log.
homepage
repositoryhttps://gitlab.com/tezos/tezos.git
max_upload_size
id848532
size5,354
Emma Turner (emturner)

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 tezos_smart_rollup_debug::debug_msg;
use tezos_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 tezos_smart_rollup_host::runtime::Runtime;

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

cargo fmt