vk/util: Add anv_loge() for logging error messages

This commit is contained in:
Chad Versace
2015-05-28 08:07:54 -07:00
parent 5f2d469e37
commit 1132080d5d
2 changed files with 22 additions and 0 deletions

View File

@@ -119,6 +119,8 @@ vk_error(VkResult error)
void __anv_finishme(const char *file, int line, const char *format, ...)
anv_printflike(3, 4);
void anv_loge(const char *format, ...) anv_printflike(1, 2);
void anv_loge_v(const char *format, va_list va);
/**
* Print a FINISHME message, including its source location.

View File

@@ -30,6 +30,26 @@
#include "private.h"
/** Log an error message. */
void anv_printflike(1, 2)
anv_loge(const char *format, ...)
{
va_list va;
va_start(va, format);
anv_loge_v(format, va);
va_end(va);
}
/** \see anv_loge() */
void
anv_loge_v(const char *format, va_list va)
{
fprintf(stderr, "vk: error: ");
vfprintf(stderr, format, va);
fprintf(stderr, "\n");
}
void anv_printflike(3, 4)
__anv_finishme(const char *file, int line, const char *format, ...)
{