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 <hlinnaka@iki.fi>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/leouteo5ozcrux3fepuhtbp6c56tbfd4naxeokidbx7m75cabz@hhw6g4urlowt
pull/185/head
Andres Freund 10 months ago
parent 631db1d4b2
commit 6a5bcf7f7d
  1. 18
      src/backend/postmaster/postmaster.c

@ -839,20 +839,20 @@ PostmasterMain(int argc, char *argv[])
#endif
/* For debugging: display postmaster environment */
if (message_level_is_interesting(DEBUG3))
{
extern char **environ;
char **p;
StringInfoData si;
ereport(DEBUG3,
(errmsg_internal("%s: PostmasterMain: initial environment dump:",
progname)));
ereport(DEBUG3,
(errmsg_internal("-----------------------------------------")));
initStringInfo(&si);
appendStringInfoString(&si, "initial environment dump:");
for (p = environ; *p; ++p)
ereport(DEBUG3,
(errmsg_internal("\t%s", *p)));
ereport(DEBUG3,
(errmsg_internal("-----------------------------------------")));
appendStringInfo(&si, "\n%s", *p);
ereport(DEBUG3, errmsg_internal("%s", si.data));
pfree(si.data);
}
/*

Loading…
Cancel
Save