1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
#![allow(clippy::manual_non_exhaustive, clippy::empty_docs)]
pub mod ext;
pub mod types;
pub use types::*;
// TODO: remove the re-export of web_sys here
pub use web_sys;
/// When debugging your Worker via `wrangler dev`, `wrangler tail`, or from the Workers Dashboard,
/// anything passed to this macro will be printed to the terminal or written to the console.
#[macro_export]
macro_rules! console_debug {
($($t:tt)*) => {
$crate::web_sys::console::debug_1(&format_args!($($t)*).to_string().into())
}
}
/// When debugging your Worker via `wrangler dev`, `wrangler tail`, or from the Workers Dashboard,
/// anything passed to this macro will be printed to the terminal or written to the console.
#[macro_export]
macro_rules! console_log {
($($t:tt)*) => {
$crate::web_sys::console::log_1(&format_args!($($t)*).to_string().into())
}
}
/// When debugging your Worker via `wrangler dev`, `wrangler tail`, or from the Workers Dashboard,
/// anything passed to this macro will be printed to the terminal or written to the console.
#[macro_export]
macro_rules! console_warn {
($($t:tt)*) => {
$crate::web_sys::console::warn_1(&format_args!($($t)*).to_string().into())
}
}
/// When debugging your Worker via `wrangler dev`, `wrangler tail`, or from the Workers Dashboard,
/// anything passed to this macro will be printed to the terminal or written to the console.
#[macro_export]
macro_rules! console_error {
($($t:tt)*) => {
$crate::web_sys::console::error_1(&format_args!($($t)*).to_string().into())
}
}