From dda219970666c0e6abd2cea83b987fa2bc3178c8 Mon Sep 17 00:00:00 2001 From: Yves Biener Date: Sat, 16 Nov 2024 21:06:42 +0100 Subject: [PATCH] bump to zig 0.14.dev --- .gitea/workflows/release.yaml | 2 +- .gitea/workflows/test.yaml | 2 +- README.md | 2 +- src/zlog.zig | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index bc0ba46..ada7bdf 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -17,7 +17,7 @@ jobs: - name: Setup zig installation uses: mlugg/setup-zig@v1 with: - version: 0.13.0 + version: master - name: Run tests run: zig build --release=fast - name: Release build artifacts diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml index 0f6bf71..02a6a3e 100644 --- a/.gitea/workflows/test.yaml +++ b/.gitea/workflows/test.yaml @@ -16,7 +16,7 @@ jobs: - name: Setup zig installation uses: mlugg/setup-zig@v1 with: - version: 0.13.0 + version: master - name: Lint check run: zig fmt --check . - name: Spell checking diff --git a/README.md b/README.md index a864630..5bd02a7 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ This will result in the following output: For more details about the output customization see the configuration options of the `zlog` module. Following options are available: - _timestamp_ (default: `true`): Prepend the current timestamp before each log message. -- _stderr_ (default: `true`): Print log messages to stderr. **NOTE**: Currently not working as log output is not appended and only the last log message will be in the resulting log file! This is a not-yet-implemented feature of the standard library of zig 0.13.0! See this [issue](https://github.com/ziglang/zig/issues/14375) for more details. +- _stderr_ (default: `true`): Print log messages to stderr. **NOTE**: Currently not working as log output is not appended and only the last log message will be in the resulting log file! This is a not-yet-implemented feature of the standard library of zig! See this [issue](https://github.com/ziglang/zig/issues/14375) for more details. ## Tips diff --git a/src/zlog.zig b/src/zlog.zig index 0b010b7..03cae86 100644 --- a/src/zlog.zig +++ b/src/zlog.zig @@ -9,7 +9,7 @@ pub const std_options: std.Options = .{ // zlog defaultLog function replacement, which adjusts the surrounding contents of every std.log message. fn logFn( comptime message_level: std.log.Level, - comptime scope: @Type(.EnumLiteral), + comptime scope: @Type(.enum_literal), comptime format: []const u8, args: anytype, ) void { @@ -71,7 +71,7 @@ fn inner_format(object: anytype, comptime fmt: []const u8, options: std.fmt.Form const Object = @TypeOf(object); const object_info = @typeInfo(Object); switch (object_info) { - .Struct => |s| { + .@"struct" => |s| { try writer.writeAll(@typeName(Object)); try writer.writeAll(" = struct {\n"); inline for (s.fields) |field| { @@ -87,7 +87,7 @@ fn inner_format(object: anytype, comptime fmt: []const u8, options: std.fmt.Form try writer.writeAll("\t" ** depth); try writer.writeAll("}"); }, - .Enum => |e| { + .@"enum" => |e| { try writer.writeAll(@typeName(Object)); try writer.writeAll(" = enum {\n"); inline for (e.fields) |field| { @@ -101,14 +101,14 @@ fn inner_format(object: anytype, comptime fmt: []const u8, options: std.fmt.Form }, // TODO: implement prett_printing for other user defined types (`union` and `vector`) // TODO: recognize []const u8 types and print them as strings - .Array => |a| { + .array => |a| { if (a.child == @TypeOf([:0]const u8)) { try std.fmt.format(writer, "\"{s}\"", .{object}); } else { try std.fmt.format(writer, "[]{s}: {any}", .{ @typeName(a.child), object }); } }, - .Vector => |v| { + .vector => |v| { if (v.child == @TypeOf([:0]const u8)) { try std.fmt.format(writer, "\"{s}\"", .{object}); } else {