authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-11-24 23:08:37-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-11-24 23:08:37-07:00
log078a7ff198c46aea98b8837ae9fab52626dd01a0
tree67cef0500968e639f4735b6b9210c959d0bbdd25
parent6b87f0dc56b82c2f27d70271626480d21a4d0d66

Cache: add debug log statement


1 files changed, 4 insertions(+), 2 deletions(-)

src/Cache.zig+4-2
......@@ -13,6 +13,7 @@ const mem = std.mem;
1313const fmt = std.fmt;
1414const Allocator = std.mem.Allocator;
1515const Compilation = @import("Compilation.zig");
16const log = std.log.scoped(.cache);
1617
1718/// Be sure to call `Manifest.deinit` after successful initialization.
1819pub fn obtain(cache: *const Cache) Manifest {
......@@ -478,6 +479,7 @@ pub const Manifest = struct {
478479 }
479480
480481 fn populateFileHash(self: *Manifest, ch_file: *File) !void {
482 log.debug("populateFileHash {s}", .{ch_file.path.?});
481483 const file = try fs.cwd().openFile(ch_file.path.?, .{});
482484 defer file.close();
483485
......@@ -581,7 +583,7 @@ pub const Manifest = struct {
581583 .target, .target_must_resolve, .prereq => {},
582584 else => |err| {
583585 try err.printError(error_buf.writer());
584 std.log.err("failed parsing {s}: {s}", .{ dep_file_basename, error_buf.items });
586 log.err("failed parsing {s}: {s}", .{ dep_file_basename, error_buf.items });
585587 return error.InvalidDepFile;
586588 },
587589 }
......@@ -593,7 +595,7 @@ pub const Manifest = struct {
593595 .prereq => |bytes| try self.addFilePost(bytes),
594596 else => |err| {
595597 try err.printError(error_buf.writer());
596 std.log.err("failed parsing {s}: {s}", .{ dep_file_basename, error_buf.items });
598 log.err("failed parsing {s}: {s}", .{ dep_file_basename, error_buf.items });
597599 return error.InvalidDepFile;
598600 },
599601 }