quiet tests
This commit is contained in:
parent
aa8dafa3ab
commit
fa4ec246c2
1 changed files with 12 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
|||
const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
|
||||
const log = std.log.scoped(.http);
|
||||
|
||||
|
|
@ -406,10 +407,17 @@ pub const Client = struct {
|
|||
// those to debug so the warn-level log stream
|
||||
// stays focused on cases the operator can act on
|
||||
// (auth, rate, server outages).
|
||||
if (response.status == .not_found) {
|
||||
log.debug("http rejection body status=404 body={s}", .{response.body});
|
||||
} else {
|
||||
log.warn("http rejection body status={d} body={s}", .{ @intFromEnum(response.status), response.body });
|
||||
//
|
||||
// Skipped entirely under `zig build test`: the
|
||||
// error-classification tests intentionally drive
|
||||
// non-2xx statuses through here, and their warn
|
||||
// output would otherwise pollute the test stream.
|
||||
if (!builtin.is_test) {
|
||||
if (response.status == .not_found) {
|
||||
log.debug("http rejection body status=404 body={s}", .{response.body});
|
||||
} else {
|
||||
log.warn("http rejection body status={d} body={s}", .{ @intFromEnum(response.status), response.body });
|
||||
}
|
||||
}
|
||||
response.allocator.free(response.body);
|
||||
if (response.etag) |e| response.allocator.free(e);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue