Uh oh!
There was an error while loading. Please reload this page.
debug statements - #45
Conversation
| std.debug.print("dsn: {s}", .{dsn}); | ||
There was a problem hiding this comment.
Potential bug: `std.debug.print` calls use the `{s}` specifier for `Dsn` and `Uri` structs, which will cause a compilation error as `{s}` requires a string.
Description: The
std.debug.printcalls atsrc/transport.zig:52andsrc/transport.zig:75attempt to print thedsnanduristructs using the{s}format specifier. In Zig,{s}is strictly for string types ([]const u8). Since neither theDsnnorstd.Uristructs implement a customformatmethod to handle this, the compiler will raise a type mismatch error. This bug will prevent the project from compiling, blocking any testing or deployment of the new transport functionality.Suggested fix: Replace the
{s}format specifier with{}to use the default struct formatting forstd.debug.print. For example, changestd.debug.print("dsn: {s}", .{dsn});tostd.debug.print("dsn: {}", .{dsn});.
severity: 0.9, confidence: 0.95
Did we get this right? 👍 / 👎 to inform future reviews.
| std.debug.print("stringifying event"); | ||
| try std.json.stringify(event, .{}, list.writer()); | ||
| const data = try list.toOwnedSlice(); | ||
| std.debug.print("Creating envelope item"); |
There was a problem hiding this comment.
Potential bug: Two `std.debug.print` calls are missing the required empty tuple argument `.{}` which will cause a compilation error.
Description: The
std.debug.printcalls on lines 147 and 152 ofsrc/transport.zigare missing their second argument. The Zig standard library requiresstd.debug.printto always be called with a tuple for its format arguments, even if the format string contains no specifiers. In such cases, an empty tuple.{}must be provided. This omission will cause a compilation failure, preventing the code from being built.Suggested fix: Add the required empty tuple argument
.{}to thestd.debug.printcalls on lines 147 and 152, like so:std.debug.print("stringifying event", .{});.
severity: 0.9, confidence: 0.98
Did we get this right? 👍 / 👎 to inform future reviews.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
No description provided.