From 9e7977b4cdd2615ae290486aaba4914441d88b2e Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 8 Apr 2024 22:22:40 +0200 Subject: [PATCH] improved address/port listening info log --- src/main.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index a0cfb25..dc3266c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -140,8 +140,10 @@ impl Config { }; let path = format!("{}/config.toml", system_path.display().to_string().as_str()); - match confy::load_path(path) { + match confy::load_path(path.clone()) { Ok(data) => { + let msg = format!("Using {}", path); + info!(msg); Ok(Config { user: user_config, system: data, @@ -174,7 +176,12 @@ async fn main() -> std::io::Result<()> { for address in config.system.addresses.iter() { for port in config.system.ports.iter() { - let msg = format!("Listening on {address}:{port}"); + let msg = if address.is_ipv6() { + format!("Listening on [{address}]:{port}") + } + else { + format!("Listening on {address}:{port}") + }; info!(msg); server = server.bind((*address, *port))? }