code: improve logging functions

this implements a modified version of the logging interface proposed
here: https://github.com/ziglang/zig/pull/5348
This commit is contained in:
Isaac Freund
2020-06-17 01:25:11 +02:00
parent 42f8076cec
commit d74323bbbf
18 changed files with 207 additions and 92 deletions

View File

@ -20,9 +20,9 @@ const Self = @This();
const std = @import("std");
const c = @import("c.zig");
const log = @import("log.zig");
const util = @import("util.zig");
const Log = @import("log.zig").Log;
const Output = @import("Output.zig");
const View = @import("View.zig");
const ViewStack = @import("view_stack.zig").ViewStack;
@ -64,7 +64,7 @@ pub fn sendViewTags(self: Self) void {
while (it.next()) |node|
view_tags.append(node.view.current_tags) catch {
c.wl_resource_post_no_memory(self.wl_resource);
Log.Error.log("out of memory", .{});
log.crit(.river_status, "out of memory", .{});
return;
};