mirror of
https://github.com/ziglang/zig.git
synced 2025-02-12 15:40:22 +00:00
std: start: use std.log instead of stderr
When main returns an error code.
This commit is contained in:
parent
dc79651e6a
commit
333b12a8f9
@ -224,7 +224,7 @@ inline fn initEventLoopAndCallMain() u8 {
|
||||
if (std.event.Loop.instance) |loop| {
|
||||
if (!@hasDecl(root, "event_loop")) {
|
||||
loop.init() catch |err| {
|
||||
std.debug.warn("error: {}\n", .{@errorName(err)});
|
||||
std.log.err("{}", .{@errorName(err)});
|
||||
if (@errorReturnTrace()) |trace| {
|
||||
std.debug.dumpStackTrace(trace.*);
|
||||
}
|
||||
@ -270,7 +270,7 @@ pub fn callMain() u8 {
|
||||
},
|
||||
.ErrorUnion => {
|
||||
const result = root.main() catch |err| {
|
||||
std.debug.warn("error: {}\n", .{@errorName(err)});
|
||||
std.log.err("{}", .{@errorName(err)});
|
||||
if (@errorReturnTrace()) |trace| {
|
||||
std.debug.dumpStackTrace(trace.*);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user