Enabling debug logging when running with"zig test"

I’ve been trying for hours and I can’t figure out how to enable debug level logging with std.log when using “zig test” to run tests in a single file, is that even possible?

Tests are super useful for debugging (especially when you use an editor like Zed which does not have a debugger or an AI companion that would like to see your logs) so it’s a bit frustrating that it’s so hard to figure this thing out :slight_smile:

Am I just using it incorrectly and I should use “std.debug” instead?

std.testing.log_level = .debug;

3 Likes

Wow, so simple, but so hard to google for, thanks!