/* Remove dump and log files? */ if (log_opts.retain) return;
/* *Trytwice.Thesecondtimemightwaitforfilestofinishbeing *unlinked,onWindows.
*/ if (!rmtree(log_opts.basedir, true))
rmtree(log_opts.basedir, true);
/* Remove pg_upgrade_output.d only if empty */ switch (pg_check_dir(log_opts.rootdir))
{ case0: /* non-existent */ case3: /* exists and contains a mount point */
Assert(false); break;
case1: /* exists and empty */ case2: /* exists and contains only dot files */
/* *Trytwice.Thesecondtimemightwaitforfilestofinish *beingunlinked,onWindows.
*/ if (!rmtree(log_opts.rootdir, true))
rmtree(log_opts.rootdir, true); break;
/* No incoming message should end in newline; we add that here. */
Assert(fmt);
Assert(fmt[0] == '\0' || fmt[strlen(fmt) - 1] != '\n');
vsnprintf(message, sizeof(message), _(fmt), ap);
/* PG_VERBOSE and PG_STATUS are only output in verbose mode */ /* fopen() on log_opts.internal might have failed, so check it */ if (((type != PG_VERBOSE && type != PG_STATUS) || log_opts.verbose) &&
log_opts.internal != NULL)
{ if (type == PG_STATUS) /* status messages get two leading spaces, see below */
fprintf(log_opts.internal, " %s\n", message); elseif (type == PG_REPORT_NONL)
fprintf(log_opts.internal, "%s", message); else
fprintf(log_opts.internal, "%s\n", message);
fflush(log_opts.internal);
}
switch (type)
{ case PG_VERBOSE: if (log_opts.verbose)
printf("%s\n", message); break;
/* prefix with "..." if we do leading truncation */
printf(" %s%-*.*s\r",
itfits ? "" : "...",
MESSAGE_WIDTH - 2, MESSAGE_WIDTH - 2,
itfits ? message :
message + strlen(message) - MESSAGE_WIDTH + 3 + 2);
} elseif (log_opts.verbose)
printf(" %s\n", message); break;
case PG_REPORT_NONL: /* This option is for use by prep_status and friends */
printf("%s", message); break;
case PG_REPORT: case PG_WARNING:
printf("%s\n", message); break;
case PG_FATAL: /* Extra newline in case we're interrupting status output */
printf("\n%s\n", message);
printf(_("Failure, exiting\n")); exit(1); break;
/* No default:, we want a warning for omitted cases */
}
fflush(stdout);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.