Add log_hint() function for logging hints

There are a few places where additional hints are written as log
output, usually LOG_NOTICE. Create an explicit function to provide
hints in a standardized manner; by storing the log level of the
previous logger call, we can ensure the hint is only displayed when
the log message itself would be.

Part of an ongoing effort to better control repmgr's logging output.
This commit is contained in:
Ian Barwick
2015-11-13 14:29:11 +09:00
parent ea01d1d30b
commit ae84041a4e
4 changed files with 30 additions and 11 deletions

View File

@@ -281,7 +281,7 @@ main(int argc, char **argv)
if (node_info.node_id == NODE_NOT_FOUND)
{
log_err(_("No metadata record found for this node - terminating\n"));
log_notice(_("HINT: was this node registered with 'repmgr (master|standby) register'?\n"));
log_hint(_("Check that 'repmgr (master|standby) register' was executed for this node\n"));
terminate(ERR_BAD_CONFIG);
}