Closed andreriesco closed 3 weeks ago
@kassane when you have some time, can you take a look on what may be the issue here, please?
Hi,
Firstly, stdout.print
works because it obviously uses stdout (w/ buffer.flush).
const stdout_file = std.io.getStdOut().writer();
var bw = std.io.bufferedWriter(stdout_file);
const stdout = bw.writer();
try stdout.print("Hello toradex.\n", .{});
try bw.flush();
But std.debug.print
and std.log.|info|debug|err
uses stderr.
// works on release mode
pub const std_options = struct {
pub const log_level = .info;
};
Remove this line, because pub const log_level = .debug
is default.
// The default log level is based on build mode.
pub const default_level: Level = switch (builtin.mode) {
.Debug => .debug,
.ReleaseSafe => .info,
.ReleaseFast, .ReleaseSmall => .err,
};
I had forked an unofficial tutorial on how std.log works, mentioned in the PR.
Got it. I added on this commit the configuration on launch.json
to print also the stderr
. Now it is possible to see the output message. Thanks.
Amazing!!
When trying to debug a
zigConsole
application on the board (Torizon ARMv8
debug command), theHello Torizon
message is not being printed on VSCode's Debug Console.However, when using
stdout.print()
instead oflog.info
it works.P.S. Local debugging (
Local AMD64
debug command) works on both cases.