-#define disorder_fatal fatal
-#define disorder_error error
-#define disorder_info info
+/** @brief Log an error and quit
+ *
+ * If @c ${DISORDER_FATAL_ABORT} is defined (as anything) then the process
+ * is aborted, so you can get a backtrace.
+ */
+void disorder_fatal(int errno_value, const char *msg, ...) {
+ va_list ap;
+
+ va_start(ap, msg);
+ elog(LOG_CRIT, errno_value, msg, ap);
+ va_end(ap);
+ if(getenv("DISORDER_FATAL_ABORT")) abort();
+ exitfn(EXIT_FAILURE);
+}
+
+/** @brief Log an error */
+void disorder_error(int errno_value, const char *msg, ...) {
+ va_list ap;
+
+ va_start(ap, msg);
+ elog(LOG_ERR, errno_value, msg, ap);
+ va_end(ap);
+}