summaryrefslogtreecommitdiff
path: root/contrib/pg_upgrade/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pg_upgrade/util.c')
-rw-r--r--contrib/pg_upgrade/util.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/contrib/pg_upgrade/util.c b/contrib/pg_upgrade/util.c
index 94eaa189b0..6977663b63 100644
--- a/contrib/pg_upgrade/util.c
+++ b/contrib/pg_upgrade/util.c
@@ -77,18 +77,19 @@ pg_log(eLogType type, char *fmt,...)
vsnprintf(message, sizeof(message), fmt, args);
va_end(args);
- if (log_opts.fd != NULL)
+ /* PG_VERBOSE is only output in verbose mode */
+ if (type != PG_VERBOSE || log_opts.verbose)
{
- fwrite(message, strlen(message), 1, log_opts.fd);
+ fwrite(message, strlen(message), 1, log_opts.internal);
/* if we are using OVERWRITE_MESSAGE, add newline */
if (strchr(message, '\r') != NULL)
- fwrite("\n", 1, 1, log_opts.fd);
- fflush(log_opts.fd);
+ fwrite("\n", 1, 1, log_opts.internal);
+ fflush(log_opts.internal);
}
switch (type)
{
- case PG_INFO:
+ case PG_VERBOSE:
if (log_opts.verbose)
printf("%s", _(message));
break;
@@ -104,11 +105,6 @@ pg_log(eLogType type, char *fmt,...)
exit(1);
break;
- case PG_DEBUG:
- if (log_opts.debug)
- fprintf(log_opts.debug_fd, "%s\n", _(message));
- break;
-
default:
break;
}