From 1a52178c1f76ae478b95f6fcc9355eba94cd8a43 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Tue, 2 Jul 2024 08:05:09 -0500 Subject: [PATCH] log: prefix all log scopes with "vaxis" --- src/Image.zig | 2 -- src/InternalScreen.zig | 2 +- src/Loop.zig | 6 ++++-- src/Parser.zig | 2 +- src/Screen.zig | 2 -- src/Window.zig | 2 -- src/main.zig | 4 ++++ src/queue.zig | 2 -- src/widgets/TextInput.zig | 2 -- src/widgets/terminal/Screen.zig | 2 +- src/xev.zig | 2 +- 11 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/Image.zig b/src/Image.zig index 2478096..063833a 100644 --- a/src/Image.zig +++ b/src/Image.zig @@ -6,8 +6,6 @@ const zigimg = @import("zigimg"); const Window = @import("Window.zig"); -const log = std.log.scoped(.image); - const Image = @This(); const transmit_opener = "\x1b_Gf=32,i={d},s={d},v={d},m={d};"; diff --git a/src/InternalScreen.zig b/src/InternalScreen.zig index f77749d..5d41940 100644 --- a/src/InternalScreen.zig +++ b/src/InternalScreen.zig @@ -5,7 +5,7 @@ const Cell = @import("Cell.zig"); const MouseShape = @import("Mouse.zig").Shape; const CursorShape = Cell.CursorShape; -const log = std.log.scoped(.internal_screen); +const log = std.log.scoped(.vaxis); const InternalScreen = @This(); diff --git a/src/Loop.zig b/src/Loop.zig index b08c64b..89a225f 100644 --- a/src/Loop.zig +++ b/src/Loop.zig @@ -6,9 +6,11 @@ const grapheme = @import("grapheme"); const GraphemeCache = @import("GraphemeCache.zig"); const Parser = @import("Parser.zig"); const Queue = @import("queue.zig").Queue; -const Tty = @import("main.zig").Tty; +const vaxis = @import("main.zig"); +const Tty = vaxis.Tty; const Vaxis = @import("Vaxis.zig"); -const log = std.log.scoped(.loop); + +const log = std.log.scoped(.vaxis); pub fn Loop(comptime T: type) type { return struct { diff --git a/src/Parser.zig b/src/Parser.zig index 98e5a1b..aea8f66 100644 --- a/src/Parser.zig +++ b/src/Parser.zig @@ -8,7 +8,7 @@ const code_point = @import("code_point"); const grapheme = @import("grapheme"); const Winsize = @import("main.zig").Winsize; -const log = std.log.scoped(.parser); +const log = std.log.scoped(.vaxis_parser); const Parser = @This(); diff --git a/src/Screen.zig b/src/Screen.zig index eb5489d..7e95944 100644 --- a/src/Screen.zig +++ b/src/Screen.zig @@ -8,8 +8,6 @@ const Winsize = @import("main.zig").Winsize; const Unicode = @import("Unicode.zig"); const Method = @import("gwidth.zig").Method; -const log = std.log.scoped(.screen); - const Screen = @This(); width: usize = 0, diff --git a/src/Window.zig b/src/Window.zig index ea7c38f..74b9eff 100644 --- a/src/Window.zig +++ b/src/Window.zig @@ -7,8 +7,6 @@ const Segment = @import("Cell.zig").Segment; const Unicode = @import("Unicode.zig"); const gw = @import("gwidth.zig"); -const log = std.log.scoped(.window); - const Window = @This(); pub const Size = union(enum) { diff --git a/src/main.zig b/src/main.zig index d253ba9..c65e8df 100644 --- a/src/main.zig +++ b/src/main.zig @@ -64,6 +64,10 @@ pub fn panic_handler(msg: []const u8, error_return_trace: ?*std.builtin.StackTra std.builtin.default_panic(msg, error_return_trace, ret_addr); } +pub const log_scopes = enum { + vaxis, +}; + /// the vaxis logo. In PixelCode pub const logo = \\▄ ▄ ▄▄▄ ▄ ▄ ▄▄▄ ▄▄▄ diff --git a/src/queue.zig b/src/queue.zig index 30cb3f2..68297d1 100644 --- a/src/queue.zig +++ b/src/queue.zig @@ -3,8 +3,6 @@ const assert = std.debug.assert; const atomic = std.atomic; const Condition = std.Thread.Condition; -const log = std.log.scoped(.queue); - /// Thread safe. Fixed size. Blocking push and pop. pub fn Queue( comptime T: type, diff --git a/src/widgets/TextInput.zig b/src/widgets/TextInput.zig index dda137d..bd08851 100644 --- a/src/widgets/TextInput.zig +++ b/src/widgets/TextInput.zig @@ -6,8 +6,6 @@ const Window = @import("../Window.zig"); const GapBuffer = @import("gap_buffer").GapBuffer; const Unicode = @import("../Unicode.zig"); -const log = std.log.scoped(.text_input); - const TextInput = @This(); /// The events that this widget handles diff --git a/src/widgets/terminal/Screen.zig b/src/widgets/terminal/Screen.zig index e040edb..6afdbb2 100644 --- a/src/widgets/terminal/Screen.zig +++ b/src/widgets/terminal/Screen.zig @@ -4,7 +4,7 @@ const vaxis = @import("../../main.zig"); const ansi = @import("ansi.zig"); -const log = std.log.scoped(.terminal); +const log = std.log.scoped(.vaxis_terminal); const Screen = @This(); diff --git a/src/xev.zig b/src/xev.zig index d0c0673..0cf36f4 100644 --- a/src/xev.zig +++ b/src/xev.zig @@ -9,7 +9,7 @@ const Key = @import("Key.zig"); const Mouse = @import("Mouse.zig"); const Color = @import("Cell.zig").Color; -const log = std.log.scoped(.tty_watcher); +const log = std.log.scoped(.vaxis_xev); pub const Event = union(enum) { key_press: Key,