reduce more unnecessary logging and improve a tad
dead servers in rooms are not relevant to log, keep it as info/debug Signed-off-by: girlbossceo <june@girlboss.ceo>
This commit is contained in:
parent
64084fb2d0
commit
6931f4b778
1 changed files with 34 additions and 26 deletions
|
@ -262,14 +262,14 @@ where
|
||||||
|
|
||||||
debug!("Getting response bytes from {destination}");
|
debug!("Getting response bytes from {destination}");
|
||||||
let body = response.bytes().await.unwrap_or_else(|e| {
|
let body = response.bytes().await.unwrap_or_else(|e| {
|
||||||
warn!("server error {}", e);
|
info!("server error {}", e);
|
||||||
Vec::new().into()
|
Vec::new().into()
|
||||||
}); // TODO: handle timeout
|
}); // TODO: handle timeout
|
||||||
debug!("Got response bytes from {destination}");
|
debug!("Got response bytes from {destination}");
|
||||||
|
|
||||||
if !status.is_success() {
|
if !status.is_success() {
|
||||||
warn!(
|
debug!(
|
||||||
"{} {}: {}",
|
"Response not successful\n{} {}: {}",
|
||||||
url,
|
url,
|
||||||
status,
|
status,
|
||||||
String::from_utf8_lossy(&body)
|
String::from_utf8_lossy(&body)
|
||||||
|
@ -314,29 +314,31 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
if e.is_timeout() {
|
// we do not need to log that servers in a room are dead, this is normal in public rooms and just spams the logs.
|
||||||
info!(
|
match e.is_timeout() {
|
||||||
|
true => info!(
|
||||||
"Timed out sending request to {} at {}: {}",
|
"Timed out sending request to {} at {}: {}",
|
||||||
destination, actual_destination_str, e
|
destination, actual_destination_str, e
|
||||||
);
|
),
|
||||||
} else if e.is_redirect() {
|
false => match e.is_connect() {
|
||||||
info!(
|
true => info!(
|
||||||
"Redirect loop sending request to {} at {}: {}\nFinal URL: {:?}",
|
"Failed to connect to {} at {}: {}",
|
||||||
destination,
|
destination, actual_destination_str, e
|
||||||
actual_destination_str,
|
),
|
||||||
e,
|
false => match e.is_redirect() {
|
||||||
e.url()
|
true => info!(
|
||||||
);
|
"Redirect loop sending request to {} at {}: {}\nFinal URL: {:?}",
|
||||||
} else if e.is_connect() {
|
destination,
|
||||||
info!(
|
actual_destination_str,
|
||||||
"Failed to connect to {} at {}: {}",
|
e,
|
||||||
destination, actual_destination_str, e
|
e.url()
|
||||||
);
|
),
|
||||||
} else {
|
false => warn!(
|
||||||
warn!(
|
"Could not send request to {} at {}: {}",
|
||||||
"Could not send request to {} at {}: {}",
|
destination, actual_destination_str, e
|
||||||
destination, actual_destination_str, e
|
),
|
||||||
);
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
Err(e.into())
|
Err(e.into())
|
||||||
}
|
}
|
||||||
|
@ -418,7 +420,10 @@ async fn find_actual_destination(destination: &'_ ServerName) -> (FedDest, FedDe
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
warn!("Using SRV record, but could not resolve to IP");
|
debug!(
|
||||||
|
"Using SRV record {}, but could not resolve to IP",
|
||||||
|
hostname_override.hostname()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(port) = force_port {
|
if let Some(port) = force_port {
|
||||||
|
@ -460,7 +465,10 @@ async fn find_actual_destination(destination: &'_ ServerName) -> (FedDest, FedDe
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
warn!("Using SRV record, but could not resolve to IP");
|
debug!(
|
||||||
|
"Using SRV record {}, but could not resolve to IP",
|
||||||
|
hostname_override.hostname()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(port) = force_port {
|
if let Some(port) = force_port {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue