Skip to content

Commit 85f67b9

Browse files
committed
Put cmd_run failure tracing behind an experimental flag
1 parent 228086a commit 85f67b9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

nob.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
but if you want to know what is discouraged you may want to enable this flag.
8181
- NOB_EXPERIMENTAL_DELETE_OLD - Experimental feature that automatically removes `nob.old` files. It's unclear how well
8282
it works on Windows, so it's experimental for now.
83+
- NOB_EXPERIMENTAL_TRACE_CMD_RUN_FAIL - Log the locations of fail nob_cmd_run()-s. It's behind an experimental flag
84+
because I'm not sure how much it alters the UX of the library for other people, but this is something I personally need.
8385
- NOB_UNSTRIP_PREFIX - do not strip the `nob_` prefixes from non-redefinable names.
8486
- NOB_NO_ECHO - do not echo the actions various nob functions are doing (like nob_cmd_run(), nob_mkdir_if_not_exists(), etc).
8587
@@ -1294,9 +1296,14 @@ NOBDEF int nob_nprocs(void)
12941296
NOBDEF bool nob__cmd_run_opt_with_location(Nob_Cmd *cmd, const char *file, int line, Nob_Cmd_Opt opt)
12951297
{
12961298
bool ok = nob_cmd_run_opt(cmd, opt);
1299+
#ifdef NOB_EXPERIMENTAL_TRACE_CMD_RUN_FAIL
12971300
if (!ok) {
12981301
nob_log(NOB_ERROR, "%s:%d: ERROR: cmd_run failed", file, line);
12991302
}
1303+
#else
1304+
NOB_UNUSED(file);
1305+
NOB_UNUSED(line);
1306+
#endif // NOB_EXPERIMENTAL_TRACE_CMD_RUN_FAIL
13001307
return ok;
13011308
}
13021309

0 commit comments

Comments
 (0)