added task logging

This commit is contained in:
2026-01-15 16:59:40 -05:00
parent 231b0ced48
commit 96c22f5237
3 changed files with 8 additions and 1 deletions

View File

@@ -12,9 +12,13 @@ function sys.spawn(func, name, envars, args, tgid)
coro=coroutine.create(function()
local ok, err = xpcall(func, debug.traceback, table.unpack(args or {}))
if not ok then
if kernel.config.logTaskExit then
kernel.log("Task "..tostring(id).." exited with err: "..tostring(err), "ERROR")
end
tasks[tostring(id)].status="Z"
tasks[tostring(id)].exit=tostring(err)
else
kernel.log("Task "..tostring(id).." exited with code: "..tostring(err), "INFO")
tasks[tostring(id)].status="Z"
tasks[tostring(id)].exit=err
end

View File

@@ -1,6 +1,7 @@
--:Minify:--
local kernel=...
kernel.tty={}
kernel.tty.inst={}
function kernel.tty.register(tty, ttyo)
kernel.tty[tty]=ttyo