1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
mod env {
    extern "C" {
        pub fn ontio_debug(data: *const u8, len: u32);
    }
}

///Used to print the debug information in the contract, which can be seen in the log of the ontology node
/// # Example
/// ```no_run
/// # use ontio_std::console;
/// console::debug("test");
/// ```
pub fn debug(msg: &str) {
    unsafe {
        env::ontio_debug(msg.as_ptr(), msg.len() as u32);
    }
}