0.1.3: add IP address to logs

Signed-off-by: Ivan Bushchik <ivabus@ivabus.dev>
This commit is contained in:
Ivan Bushchik 2024-01-29 10:47:27 +03:00
parent 5bfe7364c2
commit 84d4a9e65d
No known key found for this signature in database
GPG key ID: 2F16FBF3262E090C
3 changed files with 4 additions and 3 deletions

2
Cargo.lock generated
View file

@ -320,7 +320,7 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
[[package]]
name = "lonelyradio"
version = "0.1.2"
version = "0.1.3"
dependencies = [
"chrono",
"clap",

View file

@ -1,7 +1,7 @@
[package]
name = "lonelyradio"
description = "TCP radio for singles"
version = "0.1.2"
version = "0.1.3"
edition = "2021"
license = "MIT"
authors = [ "Ivan Bushchik <ivabus@ivabus.dev>" ]

View file

@ -58,9 +58,10 @@ async fn stream(mut s: TcpStream) {
'track: loop {
let track = pick_track(&tracklist);
println!(
"[{}] {} to {}",
"[{}] {} to {}:{}",
Local::now().to_rfc3339(),
track.to_str().unwrap(),
s.peer_addr().unwrap().ip().to_string(),
s.peer_addr().unwrap().port()
);
let file = Box::new(std::fs::File::open(track).unwrap());