diff options
| author | ihc童鞋@提不起劲 <[email protected]> | 2021-12-29 14:22:12 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-12-29 14:22:12 +0800 |
| commit | f0568ba58ef96a7b07a89cbac7adc7ba4f6a4dea (patch) | |
| tree | be5c287b9ae9138cfe1834f3362058f8406c53eb /examples | |
| parent | 5c664a503028e8e383037cedb537185479b78fb1 (diff) | |
feat: use tracing instead of eprintln as debug output (#37)
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/Cargo.toml | 5 | ||||
| -rw-r--r-- | examples/echo.rs | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 3837b73..09f158f 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -10,6 +10,11 @@ version = "0.0.0" [dev-dependencies] monoio = {path = "../monoio", features = ["sync", "utils", "bytes", "macros"]} +# Enable tracing and tracing-subscriber for print out runtime debug +# tracing information. Add these only when you enable "debug" feature. +# tracing = "0.1" +# tracing-subscriber = "0.3" + # For hyper examples hyper = {version = "0.14", features = ["http1", "client", "server", "stream"]} monoio-compat = {path = "../monoio-compat"} diff --git a/examples/echo.rs b/examples/echo.rs index f87f0eb..53bfe2b 100644 --- a/examples/echo.rs +++ b/examples/echo.rs @@ -7,6 +7,7 @@ use monoio::net::{TcpListener, TcpStream}; #[monoio::main] async fn main() { + // tracing_subscriber::fmt().with_max_level(tracing::Level::TRACE).init(); let listener = TcpListener::bind("127.0.0.1:50002").unwrap(); println!("listening"); loop { |
