log
crate for use with stdweb - No long-term maintenance intended!This crate allows you to use the usual log macros from the log
crate (info!
, debug!
, etc.) when working on a project involving stdweb
.
The logger will then call the Javascript equivalent in the browser. E.g. info!("Hello World")
=> console.info("Hello World");
.
Debug
or Trace
and your dependencies also log a lot, your console will be very full.Add this to your Cargo.toml
dependencies:
toml
hobofan_stdweb_logger = "0.1.1"
or run this if you have cargo-edit
installed:
bash
cargo add hobofan_stdweb_logger
```rust
extern crate stdweb;
extern crate log; extern crate hobofanstdweblogger as stdweb_logger;
fn main() { stdweb::initialize(); stdweblogger::Logger::initwith_level(::log::LevelFilter::Info);
info!("Hello World!"); } ```
Licensed under either of