slugger reader work resumed

This commit is contained in:
Peterino 2026-11-19 17:42:25 -07:00 committed by Peterino2
parent 2f9ca7fd8e
commit 0d3e175890
3 changed files with 33 additions and 6 deletions

View File

@ -239,8 +239,12 @@ pub fn xxdWrite2(writer: *std.Io.Writer, bytes: []const u8, options: XxdOptions)
try writer.writeByte(if (b >= 0x20 and b <= 0x7e) b else getUnprintableByte(b));
op.count -= 1;
}
try writer.writeAll(ColorOp.reset.colorAscii());
if (lineBytes.items.len < bytesPerLine) {
_ = try writer.splatByte(' ', bytesPerLine - lineBytes.items.len);
}
}
try writer.writeAll(ColorOp.reset.colorAscii());
try writer.writeAll("|\n");
addr += stride;
}

View File

@ -0,0 +1,24 @@
pub fn sluggerReaderTest(dir: *std.Io.Dir, pathname: []const u8) !void {
const io = std.testing.io;
const f = try dir.openFile(io, pathname, .{});
_ = f;
}
const std = @import("std");
const slugger = @import("slugger.zig");
const LogMem = slugger.LogMem;
const LogRef = slugger.LogRef;
const LogSite = slugger.LogSite;
const LoggerState = slugger.LoggerState;
const Verbosity = slugger.Verbosity;
const EnumTable = slugger.EnumTable;
const EnumEntry = slugger.EnumEntry;
const ArgsDecoderOp = slugger.ArgsDecoderOp;
const ArgsDecoderOpKind = slugger.ArgsDecoderOpKind;
const RenderOp = slugger.RenderOp;
const StructuredLog = slugger.StructuredLog;
const xxd = @import("p2").xxd;
const lz4 = @import("lz4");
const Lz4Writer = lz4.Lz4Writer;

View File

@ -274,14 +274,14 @@ const SlugOutput = struct {
}
for (self.mem.entries.items) |entry| {
const start = frame.written().len;
// const start = frame.written().len;
try entry.marshalToWriter(&frame.writer);
const end = frame.written().len;
// const end = frame.written().len;
xxd.print(frame.written()[start..end], start + 2);
std.debug.print("\n", .{});
// xxd.print(frame.written()[start..end], start);
// std.debug.print("\n", .{});
self.entriesWritten += 1;
}
@ -587,6 +587,5 @@ const RenderOp = slugger.RenderOp;
const StructuredLog = slugger.StructuredLog;
const xxd = @import("p2").xxd;
const debug_printBytes = xxd.debug_printBytes;
const lz4 = @import("lz4");
const Lz4Writer = lz4.Lz4Writer;