MCPcopy Create free account
hub / github.com/apache/cloudberry / write_stderr

Function write_stderr

src/backend/utils/error/elog.c:4976–5057  ·  view source on GitHub ↗

* Write errors to stderr (or by equal means when stderr is * not available). Used before ereport/elog can be used * safely (memory context, GUC load etc) */

Source from the content-addressed store, hash-verified

4974 * safely (memory context, GUC load etc)
4975 */
4976void
4977write_stderr(const char *fmt,...)
4978{
4979 va_list ap;
4980
4981#ifdef WIN32
4982 char errbuf[2048]; /* Arbitrary size? */
4983#endif
4984
4985 fmt = _(fmt);
4986
4987 va_start(ap, fmt);
4988
4989 if (Logging_collector && gp_log_format == 1)
4990 {
4991 char errbuf[2048]; /* Arbitrary size? */
4992
4993 vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
4994
4995 if (MyBackendType != B_LOGGER)
4996 {
4997 /* Write the message in the CSV format */
4998 write_message_to_server_log(LOG,
4999 0,
5000 errbuf,
5001 NULL,
5002 NULL,
5003 NULL,
5004 0,
5005 0,
5006 NULL,
5007 NULL,
5008 NULL,
5009 false,
5010 NULL,
5011 0,
5012 0,
5013 true,
5014 NULL,
5015 false);
5016 }
5017 else
5018 {
5019 ErrorData edata;
5020 memset(&edata, 0, sizeof(ErrorData));
5021 edata.elevel = LOG;
5022 edata.message = errbuf;
5023 edata.omit_location = true;
5024 if (redirection_done)
5025 write_syslogger_in_csv(&edata, true);
5026 else
5027 write_syslogger_in_csv(&edata, false);
5028 }
5029
5030 va_end(ap);
5031 return;
5032 }
5033

Callers 15

errstartFunction · 0.70
CdbProgramErrorHandlerFunction · 0.50
SelectConfigFilesFunction · 0.50
save_ps_display_argsFunction · 0.50
printMixedStructFunction · 0.50
MemoryContextErrorFunction · 0.50
gp_failed_to_allocFunction · 0.50
pg_signal_threadFunction · 0.50
crashDumpHandlerFunction · 0.50

Calls 5

write_syslogger_in_csvFunction · 0.70
write_eventlogFunction · 0.70
write_consoleFunction · 0.70
pgwin32_is_serviceFunction · 0.50

Tested by

no test coverage detected