#log #web #print

no-std web-log

Simple utilities to write into browser's console

1 stable release

1.0.1 Dec 12, 2021
1.0.0 Feb 18, 2021

#661 in WebAssembly


Used in 3 crates (2 directly)

BSL-1.0 license

10KB
217 lines

web-log

Rust Crates.io Documentation

Minimal wrapper over browser console to provide printing facilities

Features:

  • std - Enables std::io::Write implementation.

Usage

use web_log::{ConsoleType, Console};

use core::fmt::Write;

let mut writer = Console::new(ConsoleType::Info);
let _ = write!(writer, "Hellow World!");
drop(writer); //or writer.flush();

web_log::println!("Hello via macro!");
web_log::eprintln!("Error via macro!");

lib.rs:

Minimal wrapper over browser console to provide printing facilities

Features:

  • std - Enables std::io::Write implementation.

Usage

use web_log::{ConsoleType, Console};

use core::fmt::Write;

let mut writer = Console::new(ConsoleType::Info);
let _ = write!(writer, "Hellow World!");
drop(writer); //or writer.flush();

web_log::println!("Hello via macro!");
web_log::eprintln!("Error via macro!");

Dependencies

~0.7–1.4MB
~28K SLoC