improved address/port listening info log
Some checks failed
Run Tests on Code / run-tests (push) Has been cancelled
Some checks failed
Run Tests on Code / run-tests (push) Has been cancelled
This commit is contained in:
parent
38cfbdcfb8
commit
9e7977b4cd
1 changed files with 9 additions and 2 deletions
11
src/main.rs
11
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))?
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue