From a1c8bda52a9c07d32127762ee0c865660a0268ab Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 2 Jun 2020 15:39:19 -0400 Subject: diag: Unify debug printing --- exec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'exec.c') diff --git a/exec.c b/exec.c index 3c791d7..7c199a3 100644 --- a/exec.c +++ b/exec.c @@ -37,7 +37,9 @@ /** Print some debugging info. */ BFS_FORMATTER(2, 3) static void bfs_exec_debug(const struct bfs_exec *execbuf, const char *format, ...) { - if (!(execbuf->cmdline->debug & DEBUG_EXEC)) { + const struct cmdline *cmdline = execbuf->cmdline; + + if (!bfs_debug(cmdline, DEBUG_EXEC, "${blu}")) { return; } @@ -49,7 +51,7 @@ static void bfs_exec_debug(const struct bfs_exec *execbuf, const char *format, . if (execbuf->flags & BFS_EXEC_CHDIR) { fputs("dir", stderr); } - fputs(": ", stderr); + cfprintf(cmdline->cerr, "${rs}: "); va_list args; va_start(args, format); -- cgit v1.2.3