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 (std.event.Loop.instance) |loop| {
|
||||||
if (!@hasDecl(root, "event_loop")) {
|
if (!@hasDecl(root, "event_loop")) {
|
||||||
loop.init() catch |err| {
|
loop.init() catch |err| {
|
||||||
std.debug.warn("error: {}\n", .{@errorName(err)});
|
std.log.err("{}", .{@errorName(err)});
|
||||||
if (@errorReturnTrace()) |trace| {
|
if (@errorReturnTrace()) |trace| {
|
||||||
std.debug.dumpStackTrace(trace.*);
|
std.debug.dumpStackTrace(trace.*);
|
||||||
}
|
}
|
||||||
@ -270,7 +270,7 @@ pub fn callMain() u8 {
|
|||||||
},
|
},
|
||||||
.ErrorUnion => {
|
.ErrorUnion => {
|
||||||
const result = root.main() catch |err| {
|
const result = root.main() catch |err| {
|
||||||
std.debug.warn("error: {}\n", .{@errorName(err)});
|
std.log.err("{}", .{@errorName(err)});
|
||||||
if (@errorReturnTrace()) |trace| {
|
if (@errorReturnTrace()) |trace| {
|
||||||
std.debug.dumpStackTrace(trace.*);
|
std.debug.dumpStackTrace(trace.*);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user