mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-21 13:23:02 +00:00
lib: add igt_vlog to print varargs
... and put it to immediate use in igt_display_log. To make this all add up also drop the return value of igt_display_log, no one really cared anyway. Aside: I've noticed that every time another subtest runs (at least with kms_pipe_crc_basic) the log indent level moves one up ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
@@ -1074,3 +1074,30 @@ void igt_log(enum igt_log_level level, const char *format, ...)
|
||||
vprintf(format, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
/**
|
||||
* igt_vlog:
|
||||
* @level: #igt_log_level
|
||||
* @format: format string
|
||||
* @args: variable arguments lists
|
||||
*
|
||||
* This is the generic logging helper function using an explicit varargs
|
||||
* structure and hence useful to implement domain-specific logging
|
||||
* functions.
|
||||
*
|
||||
* If there is no need to wrap up a vararg list in the caller it is simpler to
|
||||
* just use igt_log().
|
||||
*/
|
||||
void igt_vlog(enum igt_log_level level, const char *format, va_list args)
|
||||
{
|
||||
assert(format);
|
||||
|
||||
if (igt_log_level > level)
|
||||
return;
|
||||
|
||||
if (level == IGT_LOG_WARN) {
|
||||
fflush(stdout);
|
||||
vfprintf(stderr, format, args);
|
||||
} else
|
||||
vprintf(format, args);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user