mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 20:10:17 +01:00
vk/util: Add anv_loge() for logging error messages
This commit is contained in:
parent
5f2d469e37
commit
1132080d5d
2 changed files with 22 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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, ...)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue