terminal: improve some debug logging

This commit is contained in:
Mitchell Hashimoto
2023-10-27 09:14:29 -07:00
parent 597f95120b
commit 4c45bfec9e
2 changed files with 5 additions and 2 deletions

View File

@ -159,7 +159,10 @@ pub const Action = union(enum) {
const value = @field(self, u_field.name);
switch (@TypeOf(value)) {
// Unicode
u21 => try std.fmt.format(writer, "'{u}'", .{value}),
u21 => try std.fmt.format(writer, "'{u}' (U+{X})", .{ value, value }),
// Byte
u8 => try std.fmt.format(writer, "0x{x}", .{value}),
// Note: we don't do ASCII (u8) because there are a lot
// of invisible characters we don't want to handle right

View File

@ -154,7 +154,7 @@ pub fn Stream(comptime Handler: type) type {
else
log.warn("unimplemented invokeCharset: {x}", .{c}),
else => log.warn("invalid C0 character, ignoring: {x}", .{c}),
else => log.warn("invalid C0 character, ignoring: 0x{x}", .{c}),
}
}