From 1a417ddac3de31137b28c0a807b0bcfbcc436ec9 Mon Sep 17 00:00:00 2001 From: Fangdun Tsai Date: Sun, 3 Dec 2023 19:30:44 +0800 Subject: [PATCH] feat(examples): enable tracing on embed --- examples/static-files/embed/Cargo.toml | 4 ++++ examples/static-files/embed/src/main.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/examples/static-files/embed/Cargo.toml b/examples/static-files/embed/Cargo.toml index 73f24174..a8c7c3fc 100644 --- a/examples/static-files/embed/Cargo.toml +++ b/examples/static-files/embed/Cargo.toml @@ -7,5 +7,9 @@ publish = false [dependencies] viz = { workspace = true, features = ["embed"] } +hyper = { workspace = true, features = ["tracing"] } tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } rust-embed.workspace = true + +tracing.workspace = true +tracing-subscriber = { workspace = true, features = ["env-filter"] } diff --git a/examples/static-files/embed/src/main.rs b/examples/static-files/embed/src/main.rs index 5e880e5d..3f78f19d 100644 --- a/examples/static-files/embed/src/main.rs +++ b/examples/static-files/embed/src/main.rs @@ -10,6 +10,8 @@ struct Asset; #[tokio::main] async fn main() -> Result<()> { + tracing_subscriber::fmt::init(); + let addr = SocketAddr::from(([127, 0, 0, 1], 3000)); let listener = TcpListener::bind(addr).await?; println!("listening on http://{addr}");