migrate to fmt-based logging in some more places

and improve logging.
This commit is contained in:
Dirk-Jan C. Binnema
2023-07-07 10:47:03 +03:00
parent 4171fe14c3
commit 31f0c40893
9 changed files with 51 additions and 54 deletions

View File

@ -30,8 +30,7 @@ Mu::mu_cmd_add(Mu::Store& store, const Options& opts)
if (!docid)
return Err(docid.error());
else
g_debug("added message @ %s, docid=%u",
file.c_str(), docid.value());
mu_debug("added message @ {}, docid={}", file, *docid);
}
return Ok();

View File

@ -129,7 +129,8 @@ topic_fields(const Options& opts)
});
colorify(fields, opts);
std::cout << fields << '\n';
std::cout << "# Message fields\n" << fields << '\n';
return Ok();
}
@ -169,8 +170,7 @@ topic_flags(const Options& opts)
colorify(flags, opts);
std::cout << flags << '\n';
std::cout << "# Message flags\n" << flags << '\n';
return Ok();
}
@ -251,8 +251,6 @@ topic_mu(const Options& opts)
std::cout << info << '\n';
// mu_println("{}", info);
return Ok();
}
@ -268,6 +266,7 @@ Mu::mu_cmd_info(const Mu::Store& store, const Options& opts)
return topic_store(store, opts);
else if (topic == "fields") {
topic_fields(opts);
std::cout << std::endl;
return topic_flags(opts);
} else if (topic == "mu") {
return topic_mu(opts);

View File

@ -30,7 +30,7 @@ Mu::mu_cmd_remove(Mu::Store& store, const Options& opts)
if (!res)
return Err(Error::Code::File, "failed to remove {}", file.c_str());
else
g_debug("removed message @ %s", file.c_str());
mu_debug("removed message @ {}", file);
}
return Ok();