From 0123f5c26d5f18bd0a1bb05151b40bb9c46de54d Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sat, 24 Jun 2023 00:39:24 -0700 Subject: [PATCH] assertLog: accept fmt/args instead of only message string --- src/lib.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.zig b/src/lib.zig index 9e30d9db5c7405879d586bbe34e887d08e6d4b09..6cc637d87a2e198846078d4e215a20f9c2b8b00b 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -502,8 +502,8 @@ pub fn opslice(slice: anytype, index: usize) ?std.meta.Child(@TypeOf(slice)) { return slice[index]; } -pub fn assertLog(ok: bool, message: string) void { - if (!ok) std.log.err("assertion failure: {s}", .{message}); +pub fn assertLog(ok: bool, comptime message: string, args: anytype) void { + if (!ok) std.log.err("assertion failure: " ++ message, args); if (!ok) unreachable; // assertion failure } -- 2.54.0