ref(logging): Remove message from LogExt::log_err (#4235)

This removes the message that needed to be supplied to LogExt::log_err
calls.  This was from a time before we adopted anyhow and now we are
better off using anyhow::Context::context for the message: it is more
consistent, composes better and is less custom.

The benefit of the composition can be seen in the FFI calls which need
to both log the error as well as return it to the caller via
the set_last_error mechanism.

It also removes the LogExt::ok_or_log_msg funcion for the same reason,
the message is obsoleted by anyhow's context.
This commit is contained in:
Floris Bruynooghe
2023-03-30 10:13:07 +02:00
committed by GitHub
parent 585b8ece58
commit 82ace72527
6 changed files with 145 additions and 101 deletions

View File

@@ -757,7 +757,9 @@ pub async fn housekeeping(context: &Context) -> Result<()> {
(),
)
.await
.ok_or_log_msg(context, "failed to remove old MDNs");
.context("failed to remove old MDNs")
.log_err(context)
.ok();
info!(context, "Housekeeping done.");
Ok(())