improved address/port listening info log
Some checks failed
Run Tests on Code / run-tests (push) Has been cancelled

This commit is contained in:
Neshura 2024-04-08 22:22:40 +02:00
parent 38cfbdcfb8
commit 9e7977b4cd
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C

View file

@ -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))?
}