authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-06-24 00:39:24 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-06-24 00:39:24 -07:00
log0123f5c26d5f18bd0a1bb05151b40bb9c46de54d
tree75cc0aa56a9041a25c059759308d122c0c554da9
parent170fbd40697046e5c434510066d3166a397bb110

assertLog: accept fmt/args instead of only message string


1 files changed, 2 insertions(+), 2 deletions(-)

src/lib.zig+2-2
...@@ -502,8 +502,8 @@ pub fn opslice(slice: anytype, index: usize) ?std.meta.Child(@TypeOf(slice)) {...@@ -502,8 +502,8 @@ pub fn opslice(slice: anytype, index: usize) ?std.meta.Child(@TypeOf(slice)) {
502 return slice[index];502 return slice[index];
503}503}
504504
505pub fn assertLog(ok: bool, message: string) void {505pub fn assertLog(ok: bool, comptime message: string, args: anytype) void {
506 if (!ok) std.log.err("assertion failure: {s}", .{message});506 if (!ok) std.log.err("assertion failure: " ++ message, args);
507 if (!ok) unreachable; // assertion failure507 if (!ok) unreachable; // assertion failure
508}508}
509509