Skip to content

Instantly share code, notes, and snippets.

@Kixiron
Created May 4, 2019 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kixiron/c71009191cfdca5931dcd033d7350a99 to your computer and use it in GitHub Desktop.
Save Kixiron/c71009191cfdca5931dcd033d7350a99 to your computer and use it in GitHub Desktop.
WASM Console.log()
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(js_namespace = console)]
fn log(s: &str);
}
macro_rules! console_log {
($($t:tt)*) => (log(&format_args!($($t)*).to_string()))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment