-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.rs
More file actions
23 lines (19 loc) · 772 Bytes
/
main.rs
File metadata and controls
23 lines (19 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
mod app;
use app::App;
use tracing_subscriber::{filter::Targets, prelude::*};
use tracing_web::MakeWebConsoleWriter;
fn main() {
// Configure tracing to output to browser console
let fmt_layer = tracing_subscriber::fmt::layer()
.with_ansi(true) // This might not work in all browsers
.without_time() // std::time is not available in browsers
.with_writer(MakeWebConsoleWriter::new())
.with_filter(
Targets::new()
.with_target("yew", tracing::Level::DEBUG) // yew trace can be verbose
.with_default(tracing::Level::TRACE),
);
tracing_subscriber::registry().with(fmt_layer).init();
tracing::info!("Starting Yew application");
yew::Renderer::<App>::new().render();
}