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:
Daniel Vetter
2014-03-13 17:27:47 +01:00
parent 1e9e1baba3
commit bd53d722dd
3 changed files with 33 additions and 10 deletions
+5 -10
View File
@@ -817,23 +817,18 @@ const char *plane_name(enum igt_plane p)
} while (0)
#define LOG(d, fmt, ...) igt_display_log(d, fmt, ## __VA_ARGS__)
static int __attribute__((format(printf, 2, 3)))
static void __attribute__((format(printf, 2, 3)))
igt_display_log(igt_display_t *display, const char *fmt, ...)
{
va_list args;
int n, i;
if (igt_log_level > IGT_LOG_DEBUG)
return 0;
int i;
va_start(args, fmt);
n = printf("display: ");
igt_debug("display: ");
for (i = 0; i < display->log_shift; i++)
n += printf("%s", LOG_SPACES);
n += vprintf(fmt, args);
igt_debug("%s", LOG_SPACES);
igt_vlog(IGT_LOG_DEBUG, fmt, args);
va_end(args);
return n;
}
static void igt_display_log_shift(igt_display_t *display, int shift)