wok_log 0.0.0

logging macros and wrappers for the wok web framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#![allow(dead_code)]

use wasm_bindgen::JsValue;

pub const DEBUG: fn(&JsValue) = web_sys::console::debug_1;
pub const INFO: fn(&JsValue) = web_sys::console::log_1;
pub const WARN: fn(&JsValue) = web_sys::console::warn_1;
pub const ERROR: fn(&JsValue) = web_sys::console::error_1;

pub fn drive_log(func: fn(&JsValue), value: impl AsRef<str>) {
    func(&JsValue::from_str(value.as_ref()))
}