Skip to content

Commit 6a5bcf7

Browse files
committed
postmaster: Reduce verbosity of environment dump debug message
Emitting each variable separately is unnecessarily verbose / hard to skim over. Emit the whole thing in one ereport() to address that. Also remove program name and function reference from the message. The former doesn't seem particularly helpful and the latter is provided by the elog.c infrastructure these days. Reviewed-by: Heikki Linnakangas <[email protected]> Reviewed-by: Peter Eisentraut <[email protected]> Discussion: https://postgr.es/m/leouteo5ozcrux3fepuhtbp6c56tbfd4naxeokidbx7m75cabz@hhw6g4urlowt
1 parent 631db1d commit 6a5bcf7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/backend/postmaster/postmaster.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -839,20 +839,20 @@ PostmasterMain(int argc, char *argv[])
839839
#endif
840840

841841
/* For debugging: display postmaster environment */
842+
if (message_level_is_interesting(DEBUG3))
842843
{
843844
extern char **environ;
844845
char **p;
846+
StringInfoData si;
845847

846-
ereport(DEBUG3,
847-
(errmsg_internal("%s: PostmasterMain: initial environment dump:",
848-
progname)));
849-
ereport(DEBUG3,
850-
(errmsg_internal("-----------------------------------------")));
848+
initStringInfo(&si);
849+
850+
appendStringInfoString(&si, "initial environment dump:");
851851
for (p = environ; *p; ++p)
852-
ereport(DEBUG3,
853-
(errmsg_internal("\t%s", *p)));
854-
ereport(DEBUG3,
855-
(errmsg_internal("-----------------------------------------")));
852+
appendStringInfo(&si, "\n%s", *p);
853+
854+
ereport(DEBUG3, errmsg_internal("%s", si.data));
855+
pfree(si.data);
856856
}
857857

858858
/*

0 commit comments

Comments
 (0)