Skip to content

Commit 9ddfca2

Browse files
committed
log
1 parent 075db7d commit 9ddfca2

File tree

4 files changed

+155
-1
lines changed

4 files changed

+155
-1
lines changed

Cargo.lock

Lines changed: 142 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9+
log = "0.4.17" # A lightweight logging facade for Rust
10+
env_logger = "0.10.0" # A logging implementation for `log` which is configured via an environment variable.
911
tokio-tungstenite = "0.18.0" # Tokio binding for Tungstenite, the Lightweight stream-based WebSocket implementation
1012
tokio = { version = "1.26.0", features = ["full"] } # An event-driven, non-blocking I/O platform for writing asynchronous I/O backed applications.
1113
futures-util = { version = "0.3", default-features = false, features = ["sink", "std"] }
14+
15+
[dependencies.tungstenite]
16+
version = "0.18.0"
17+
default-features = false

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
11
# tcp2ws
2+
3+
# development
4+
5+
```
6+
RUST_LOG=debug cargo run -- server
7+
```

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ async fn run() -> Result<(), Error> {
1212

1313
#[tokio::main]
1414
async fn main() -> Result<(), Error> {
15+
env_logger::init();
1516
run().await
1617
}

0 commit comments

Comments
 (0)