Crates.io | gloo-console |
lib.rs | gloo-console |
version | 0.3.0 |
source | src |
created_at | 2021-07-28 08:38:58.512662 |
updated_at | 2023-08-11 16:06:09.772995 |
description | Convenience crate for working with browser's console |
homepage | https://github.com/rustwasm/gloo |
repository | https://github.com/rustwasm/gloo/tree/master/crates/console |
max_upload_size | |
id | 428221 |
size | 17,166 |
gloo-console
Built with 🦀🕸 by The Rust and WebAssembly Working Group
The JavaScript's console
object provides access to the browser's console.
Using the console
object in Rust/WASM directly is cumbersome as it requires JavaScript glue code.
This crate exists to solve this problem by providing a set of ergonomic Rust APIs to deal
with the browser console.
The following example logs text to the console using console.log
use gloo_console::log;
let object = JsValue::from("any JsValue can be logged");
log!("text", object);