motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 078a7ff198c46aea98b8837ae9fab52626dd01a0 (tree)
parent 6b87f0dc56b82c2f27d70271626480d21a4d0d66
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Wed, 24 Nov 2021 23:08:37 -0700

Cache: add debug log statement

Diffstat:
Msrc/Cache.zig | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/Cache.zig b/src/Cache.zig @@ -13,6 +13,7 @@ const mem = std.mem; const fmt = std.fmt; const Allocator = std.mem.Allocator; const Compilation = @import("Compilation.zig"); +const log = std.log.scoped(.cache); /// Be sure to call `Manifest.deinit` after successful initialization. pub fn obtain(cache: *const Cache) Manifest { @@ -478,6 +479,7 @@ pub const Manifest = struct { } fn populateFileHash(self: *Manifest, ch_file: *File) !void { + log.debug("populateFileHash {s}", .{ch_file.path.?}); const file = try fs.cwd().openFile(ch_file.path.?, .{}); defer file.close(); @@ -581,7 +583,7 @@ pub const Manifest = struct { .target, .target_must_resolve, .prereq => {}, else => |err| { try err.printError(error_buf.writer()); - std.log.err("failed parsing {s}: {s}", .{ dep_file_basename, error_buf.items }); + log.err("failed parsing {s}: {s}", .{ dep_file_basename, error_buf.items }); return error.InvalidDepFile; }, } @@ -593,7 +595,7 @@ pub const Manifest = struct { .prereq => |bytes| try self.addFilePost(bytes), else => |err| { try err.printError(error_buf.writer()); - std.log.err("failed parsing {s}: {s}", .{ dep_file_basename, error_buf.items }); + log.err("failed parsing {s}: {s}", .{ dep_file_basename, error_buf.items }); return error.InvalidDepFile; }, }