typedef struct XLogDumpConfig
{
/* display options */
+ bool quiet;
bool bkp_details;
int stop_after_records;
int already_displayed_records;
printf(_(" -p, --path=PATH directory in which to find log segment files or a\n"
" directory with a ./pg_wal that contains such files\n"
" (default: current directory, ./pg_wal, $PGDATA/pg_wal)\n"));
+ printf(_(" -q, --quiet do not print any output, except for errors\n"));
printf(_(" -r, --rmgr=RMGR only show records generated by resource manager RMGR;\n"
" use --rmgr=list to list valid resource manager names\n"));
printf(_(" -s, --start=RECPTR start reading at WAL location RECPTR\n"));
{"help", no_argument, NULL, '?'},
{"limit", required_argument, NULL, 'n'},
{"path", required_argument, NULL, 'p'},
+ {"quiet", no_argument, NULL, 'q'},
{"rmgr", required_argument, NULL, 'r'},
{"start", required_argument, NULL, 's'},
{"timeline", required_argument, NULL, 't'},
private.endptr = InvalidXLogRecPtr;
private.endptr_reached = false;
+ config.quiet = false;
config.bkp_details = false;
config.stop_after_records = -1;
config.already_displayed_records = 0;
goto bad_argument;
}
- while ((option = getopt_long(argc, argv, "be:fn:p:r:s:t:x:z",
+ while ((option = getopt_long(argc, argv, "be:fn:p:qr:s:t:x:z",
long_options, &optindex)) != -1)
{
switch (option)
case 'p':
waldir = pg_strdup(optarg);
break;
+ case 'q':
+ config.quiet = true;
+ break;
case 'r':
{
int i;
config.filter_by_xid != record->xl_xid)
continue;
- /* process the record */
- if (config.stats == true)
- XLogDumpCountRecord(&config, &stats, xlogreader_state);
- else
- XLogDumpDisplayRecord(&config, xlogreader_state);
+ /* perform any per-record work */
+ if (!config.quiet)
+ {
+ if (config.stats == true)
+ XLogDumpCountRecord(&config, &stats, xlogreader_state);
+ else
+ XLogDumpDisplayRecord(&config, xlogreader_state);
+ }
/* check whether we printed enough */
config.already_displayed_records++;