Improve logging of configuration file operations

This commit is contained in:
Ian Barwick
2015-03-03 18:14:26 +09:00
parent 63b9254be4
commit 238fc589a1
2 changed files with 9 additions and 8 deletions

View File

@@ -46,7 +46,7 @@ parse_config(const char *config_file, t_configuration_options *options)
char config_file_buf[MAXLEN];
char name[MAXLEN];
char value[MAXLEN];
bool config_file_provided = true;
bool config_file_provided = false;
FILE *fp;
/* Sanity checks */

View File

@@ -404,10 +404,12 @@ main(int argc, char **argv)
}
if (runtime_options.verbose)
/* Logging is not yet set up, so using printf() */
printf(_("Opening configuration file: %s\n"),
runtime_options.config_file);
if (runtime_options.verbose && runtime_options.config_file[0])
{
log_notice(_("Opening configuration file: %s\n"),
runtime_options.config_file);
}
/*
* The configuration file is not required for some actions (e.g. 'standby clone'),
@@ -1053,7 +1055,6 @@ do_standby_clone(void)
exit(ERR_BAD_CONFIG);
}
log_debug(_("standby clone: %i tuples\n"), PQntuples(res));
for (i = 0; i < PQntuples(res); i++)
{
if (strcmp(PQgetvalue(res, i, 0), "data_directory") == 0)
@@ -2276,12 +2277,12 @@ run_basebackup()
termPQExpBuffer(&params);
log_info(_("Executing: '%s'\n"), script);
r = system(script);
/*
* As of 9.4, pg_basebackup et al only ever return 0 or 1
*/
log_debug(_("r = %i, %i\n"), r, WEXITSTATUS(r));
r = system(script);
return r;
}