loki level is error if unable to parse json

This commit is contained in:
Jeffrey C. Ollie 2023-10-15 15:30:11 -05:00
parent dab10464fe
commit 210dc72ca5
Signed by: jeff
GPG key ID: 6F86035A6D97044E

View file

@ -211,11 +211,14 @@ pub fn main() !void {
iperf3_log.err("error from iperf3: {s}", .{err});
level = loki.LogLevel.@"error";
}
} else |err| switch (err) {
} else |err| {
switch (err) {
error.UnknownField => iperf3_log.err("unknown field parsing json {d}", .{timestamp}),
error.UnexpectedEndOfInput => iperf3_log.err("unexpected end of input parsing json {d}", .{timestamp}),
else => iperf3_log.err("other error while parsing json {} {d}", .{ err, timestamp }),
}
level = loki.LogLevel.@"error";
}
// var line = std.ArrayList(u8).init(allocator);
// try std.json.stringify(