fix(web): tracing in web too

This commit is contained in:
əlemi 2024-05-23 05:53:05 +02:00
parent 9b64503c02
commit cd67863a47
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 11 additions and 2 deletions

View file

@ -14,7 +14,8 @@ repository = "https://git.alemi.dev/upub.git"
[dependencies]
log = "0.4"
tracing = "0.1"
console_log = "1.0"
tracing-subscriber = "0.3"
tracing-subscriber-wasm = "0.1"
console_error_panic_hook = "0.1"
thiserror = "1"
serde = { version = "1", features = ["derive"] }

View file

@ -1,6 +1,14 @@
fn main() {
_ = console_log::init_with_level(log::Level::Info);
console_error_panic_hook::set_once();
tracing_subscriber::fmt()
.with_writer(
tracing_subscriber_wasm::MakeConsoleWriter::default()
.map_trace_level_to(tracing::Level::DEBUG)
)
.with_ansi(false)
.without_time()
.init();
leptos::mount_to_body(upub_web::App);
}