diff options
author | Thomas Wood <thomas.wood@intel.com> | 2014-12-17 11:37:31 +0000 |
---|---|---|
committer | Thomas Wood <thomas.wood@intel.com> | 2015-01-16 11:11:10 +0000 |
commit | 0167619bbcc6b45b4045a85468007ecc9f606c71 (patch) | |
tree | 96276f6a69098e1c0d13c2de517b5eaa24802fbc /lib/igt_core.c | |
parent | df11a0f4a83a78ca63e04ff915a77e33cf8422fe (diff) |
lib: use critical log level for assertion failure messages
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r-- | lib/igt_core.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c index 1ead7835..87a13a76 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -897,27 +897,24 @@ static bool run_under_gdb(void) strncmp(basename(buf), "gdb", 3) == 0); } -void __igt_fail_assert(int exitcode, const char *file, +void __igt_fail_assert(int exitcode, const char *domain, const char *file, const int line, const char *func, const char *assertion, const char *f, ...) { va_list args; int err = errno; - char *err_str = NULL; + igt_log(domain, IGT_LOG_CRITICAL, + "Test assertion failure function %s, file %s:%i:\n", func, file, + line); + igt_log(domain, IGT_LOG_CRITICAL, "Failed assertion: %s\n", assertion); if (err) - asprintf(&err_str, "Last errno: %i, %s\n", err, strerror(err)); - - printf("Test assertion failure function %s, file %s:%i:\n" - "Failed assertion: %s\n" - "%s", - func, file, line, assertion, err_str ?: ""); - - free(err_str); + igt_log(domain, IGT_LOG_CRITICAL, "Last errno: %i, %s\n", err, + strerror(err)); if (f) { va_start(args, f); - vprintf(f, args); + igt_vlog(domain, IGT_LOG_CRITICAL, f, args); va_end(args); } |