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

Function write_syslogger_file_string

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

* Directly write a string to the syslogger file or stderr. */

Source from the content-addressed store, hash-verified

3987 * Directly write a string to the syslogger file or stderr.
3988 */
3989static inline void
3990write_syslogger_file_string(const char *str, bool amsyslogger, bool append_comma)
3991{
3992 if (str != NULL && str[0] != '\0')
3993 {
3994 if (amsyslogger)
3995 {
3996 write_syslogger_file_binary("\"", 1, LOG_DESTINATION_STDERR);
3997 syslogger_write_str(str, strlen(str), true, true);
3998 write_syslogger_file_binary("\"", 1, LOG_DESTINATION_STDERR);
3999 }
4000 else
4001 {
4002 ignore_returned_result(write(fileno(stderr), "\"", 1));
4003 syslogger_write_str(str, strlen(str), false, true);
4004 ignore_returned_result(write(fileno(stderr), "\"", 1));
4005 }
4006 }
4007
4008 if (append_comma)
4009 {
4010 if (amsyslogger)
4011 write_syslogger_file_binary(",", 1, LOG_DESTINATION_STDERR);
4012 else
4013 ignore_returned_result(write(fileno(stderr), ",", 1));
4014 }
4015}
4016
4017
4018/*

Callers 1

write_syslogger_in_csvFunction · 0.70

Calls 3

syslogger_write_strFunction · 0.85
ignore_returned_resultFunction · 0.70

Tested by

no test coverage detected