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

Function write_log

src/backend/cdb/cdbthreadlog.c:104–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void
105write_log(const char *fmt,...)
106{
107 char logprefix[1024];
108 char tempbuf[25];
109 va_list ap;
110
111 fmt = _(fmt);
112
113 va_start(ap, fmt);
114
115 if (Logging_collector && gp_log_format == 1)
116 {
117 char errbuf[2048]; /* Arbitrary size? */
118
119 vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
120
121 /* Write the message in the CSV format */
122 write_message_to_server_log(LOG,
123 0,
124 errbuf,
125 NULL,
126 NULL,
127 NULL,
128 0,
129 0,
130 NULL,
131 NULL,
132 NULL,
133 false,
134 NULL,
135 0,
136 0,
137 true,
138 NULL,
139 false);
140
141 va_end(ap);
142 return;
143 }
144
145 get_timestamp(logprefix, sizeof(logprefix));
146 strcat(logprefix, "|");
147 if (MyProcPort)
148 {
149 const char *username = MyProcPort->user_name;
150
151 if (username == NULL || *username == '\0')
152 username = "";
153 strcat(logprefix, username); /* user */
154 }
155
156 strcat(logprefix, "|");
157 if (MyProcPort)
158 {
159 const char *dbname = MyProcPort->database_name;
160
161 if (dbname == NULL || *dbname == '\0')

Callers 15

handleRTOFunction · 0.85
setRxThreadErrorFunction · 0.85
findConnByHeaderFunction · 0.85
sendControlMessageFunction · 0.85
sendAckFunction · 0.85
sendDisorderAckFunction · 0.85
getRxBufferFunction · 0.85
icBufferListLogFunction · 0.85
icBufferListCheckFunction · 0.85
logPktFunction · 0.85
handleAckedPacketFunction · 0.85
handleAcksFunction · 0.85

Calls 7

get_timestampFunction · 0.85
pthread_selfFunction · 0.85
pthread_mutex_lockFunction · 0.85
pthread_mutex_unlockFunction · 0.85
write_eventlogFunction · 0.70
pgwin32_is_serviceFunction · 0.50

Tested by

no test coverage detected