std: start: use std.log instead of stderr

When main returns an error code.
This commit is contained in:
Andrew Kelley 2020-09-18 01:58:16 -07:00
parent dc79651e6a
commit 333b12a8f9

View File

@ -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.*);
}