lib: debug-log moving / unlinking

This commit is contained in:
Dirk-Jan C. Binnema
2023-12-06 20:29:27 +02:00
parent 0ee0a26689
commit 8bdf6b42a2
2 changed files with 10 additions and 3 deletions

View File

@ -102,7 +102,6 @@ struct OutputStream {
quote(fname_);
}
/**
* Delete file, if any. Only do this when the OutputStream is no
* longer needed.
@ -112,6 +111,8 @@ struct OutputStream {
return;
if (auto&&res{::unlink(fname_.c_str())}; res != 0)
mu_warning("failed to unlink '{}'", ::strerror(res));
else
mu_debug("unlinked output-stream {}", fname_);
}
private:
@ -1076,7 +1077,10 @@ Server::Private::remove_handler(const Command& cmd)
if (!store().remove_message(path))
mu_warning("failed to remove message @ {} ({}) from store", path, docid);
output_sexp(Sexp().put_props(":remove", docid)); // act as if it worked.
else
mu_debug("removed message @ {} @ ({})", path, docid);
output_sexp(Sexp().put_props(":remove", docid)); // act as if it worked.
}
void