How to log to the console in Rust WebAssembly?

Example

The web_sys::console::log_2 function output a string with 1 substituion to the web console.


pub fn console_log2() {
     web_sys::console::log_2(&"%s : Hello World".into(),&"John".into());
}
                                    

Source Code