MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / ERR_log

Function ERR_log

src/jrd/err.cpp:163–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161
162
163void ERR_log(int facility, int number, const TEXT* message)
164{
165/**************************************
166 *
167 * E R R _ l o g
168 *
169 **************************************
170 *
171 * Functional description
172 * Log a message to the firebird.log
173 *
174 **************************************/
175 TEXT errmsg[MAX_ERRMSG_LEN + 1];
176 thread_db* tdbb = JRD_get_thread_data();
177
178 if (message)
179 fb_utils::copy_terminate(errmsg, message, sizeof(errmsg));
180 else if (gds__msg_lookup(0, facility, number, sizeof(errmsg), errmsg, NULL) < 1)
181 strcpy(errmsg, "Internal error code");
182
183 const size_t len = strlen(errmsg);
184 fb_utils::snprintf(errmsg + len, sizeof(errmsg) - len, " (%d)", number);
185
186 gds__log("Database: %s\n\t%s", (tdbb && tdbb->getAttachment()) ?
187 tdbb->getAttachment()->att_filename.c_str() : "", errmsg);
188}
189
190
191void ERR_post_warning(const Arg::StatusVector& v)

Callers 1

lock_bufferFunction · 0.85

Calls 5

JRD_get_thread_dataFunction · 0.85
copy_terminateFunction · 0.50
snprintfFunction · 0.50
getAttachmentMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected