Only log some debug items if verbose flag is set.

This commit is contained in:
Ian Barwick
2015-10-23 08:29:35 +09:00
parent 5c59e8fc5b
commit 6e7eee4c01

View File

@@ -457,7 +457,10 @@ main(int argc, char **argv)
do
{
log_debug("standby check loop...\n");
if (verbose)
{
log_debug("standby check loop...\n");
}
if (node_info.type == WITNESS)
{
@@ -1013,7 +1016,11 @@ standby_monitor(void)
* Execute the query asynchronously, but don't check for a result. We will
* check the result next time we pause for a monitor step.
*/
log_debug("standby_monitor: %s\n", sqlquery);
if (verbose)
{
log_debug("standby_monitor:() %s\n", sqlquery);
}
if (PQsendQuery(master_conn, sqlquery) == 0)
log_warning(_("query could not be sent to master. %s\n"),
PQerrorMessage(master_conn));
@@ -1193,6 +1200,7 @@ do_master_failover(void)
{
log_info(_("unable to retrieve node's last standby location: %s\n"),
PQerrorMessage(node_conn));
log_debug(_("connection details: %s\n"), nodes[i].conninfo_str);
PQclear(res);
PQfinish(node_conn);
@@ -1336,6 +1344,9 @@ do_master_failover(void)
PQclear(res);
/* If position is 0/0, keep checking */
/* XXX we should add a timeout here to prevent infinite looping
* if the other node's repmgrd is not up
*/
continue;
}