loki level is error if unable to parse json
This commit is contained in:
parent
dab10464fe
commit
210dc72ca5
1 changed files with 7 additions and 4 deletions
11
src/main.zig
11
src/main.zig
|
@ -211,10 +211,13 @@ pub fn main() !void {
|
|||
iperf3_log.err("error from iperf3: {s}", .{err});
|
||||
level = loki.LogLevel.@"error";
|
||||
}
|
||||
} 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 }),
|
||||
} 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);
|
||||
|
|
Loading…
Reference in a new issue