/* * elog - log to stderr and exit if ERROR or FATAL */ void elog(int elevel, const char *fmt, ...) { va_list args; bool ok; size_t len; pgutErrorData *edata; if (quiet && elevel < WARNING) return; if (elevel < pgut_abort_level && elevel < pgut_log_level && !debug) return; edata = pgut_errinit(elevel); do { va_start(args, fmt); ok = appendStringInfoVA_c(&edata->msg, fmt, args); va_end(args); } while (!ok); len = strlen(fmt); if ( len > 2 && strcmp(fmt + len -2, ": ") == 0) appendStringInfoString(&edata->msg, strerror(edata->save_errno)); trimStringBuffer(&edata->msg); pgut_errfinish(true); }
bool pgut_errstart(int elevel) { if (elevel < pgut_abort_level && !log_required(elevel, pgut_log_level)) return false; pgut_errinit(elevel); return true; }
bool pgut_errstart(int elevel) { if (quiet && elevel < WARNING) return false; if (elevel < pgut_abort_level && elevel < pgut_log_level && !debug) return false; pgut_errinit(elevel); return true; }