Reduce log level

This commit is contained in:
jude 2023-07-30 12:14:47 +01:00
parent b1f25be5d7
commit a58b9866ea
2 changed files with 12 additions and 6 deletions

View File

@ -580,7 +580,7 @@ WHERE
if let Ok(webhook) = webhook_res { if let Ok(webhook) = webhook_res {
send_to_webhook(cache_http, &self, webhook, embed).await send_to_webhook(cache_http, &self, webhook, embed).await
} else { } else {
warn!("Webhook vanished: {:?}", webhook_res); warn!("Webhook vanished for reminder {}: {:?}", self.id, webhook_res);
self.reset_webhook(pool).await; self.reset_webhook(pool).await;
send_to_channel(cache_http, &self, embed).await send_to_channel(cache_http, &self, embed).await
@ -590,21 +590,27 @@ WHERE
}; };
if let Err(e) = result { if let Err(e) = result {
error!("Error sending reminder {}: {:?}", self.id, e);
if let Error::Http(error) = e { if let Error::Http(error) = e {
if error.status_code() == Some(StatusCode::NOT_FOUND) { if error.status_code() == Some(StatusCode::NOT_FOUND) {
warn!("Seeing channel is deleted. Removing reminder"); error!(
"Reminder {} could not be sent as channel doesn't exist: {:?}",
self.id, e
);
self.force_delete(pool).await; self.force_delete(pool).await;
} else if let HttpError::UnsuccessfulRequest(error) = *error { } else if let HttpError::UnsuccessfulRequest(error) = *error {
if error.error.code == 50007 { if error.error.code == 50007 {
warn!("User cannot receive DMs"); error!(
"Reminder {} could not be sent as user has DMs disabled: {:?}",
self.id, e
);
self.force_delete(pool).await; self.force_delete(pool).await;
} else { } else {
error!("HTTP Error sending reminder {}: {:?}", self.id, e);
self.refresh(pool).await; self.refresh(pool).await;
} }
} }
} else { } else {
error!("Non-HTTP Error sending reminder {}: {:?}", self.id, e);
self.refresh(pool).await; self.refresh(pool).await;
} }
} else { } else {

View File

@ -8,7 +8,7 @@ ExecStart=/usr/bin/reminder-rs
WorkingDirectory=/etc/reminder-rs WorkingDirectory=/etc/reminder-rs
Restart=always Restart=always
RestartSec=4 RestartSec=4
Environment="RUST_LOG=warn,reminder_rs=info,postman=info" Environment="RUST_LOG=warn,reminder_rs=warn,postman=warn"
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target