~danyspin97/benice

d6e99f550601fe25d0a26fce1fa23eee2cdc36bc — Danilo Spinella 5 months ago 95ecd13
log: Skip warnings when stderr is not a terminal
1 files changed, 5 insertions(+), 0 deletions(-)

M src/log.zig
M src/log.zig => src/log.zig +5 -0
@@ 25,6 25,11 @@ pub fn log(
    comptime format: []const u8,
    args: anytype,
) void {
    // If the stderr is not a terminal, do not print warnings
    if (!std.os.isatty(std.os.STDERR_FILENO) and level == .warn) {
        return;
    }

    // Ignore all non-critical logging from sources other than
    // .my_project and .nice_library
    const scope_prefix = "(" ++ switch (scope) {