| 161 | |
| 162 | |
| 163 | void 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 | |
| 191 | void ERR_post_warning(const Arg::StatusVector& v) |
no test coverage detected