From: Chad Versace Date: Thu, 28 May 2015 15:07:54 +0000 (-0700) Subject: vk/util: Add anv_loge() for logging error messages X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1132080d5d5ea4c337a5fc4e4a24a06e14a7d9cd;p=mesa.git vk/util: Add anv_loge() for logging error messages --- diff --git a/src/vulkan/private.h b/src/vulkan/private.h index 0d199c836a3..fc7f65598f5 100644 --- a/src/vulkan/private.h +++ b/src/vulkan/private.h @@ -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. diff --git a/src/vulkan/util.c b/src/vulkan/util.c index 13af882cffd..cbeb663b5ef 100644 --- a/src/vulkan/util.c +++ b/src/vulkan/util.c @@ -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, ...) {