added task logging
This commit is contained in:
@@ -12,9 +12,13 @@ function sys.spawn(func, name, envars, args, tgid)
|
|||||||
coro=coroutine.create(function()
|
coro=coroutine.create(function()
|
||||||
local ok, err = xpcall(func, debug.traceback, table.unpack(args or {}))
|
local ok, err = xpcall(func, debug.traceback, table.unpack(args or {}))
|
||||||
if not ok then
|
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)].status="Z"
|
||||||
tasks[tostring(id)].exit=tostring(err)
|
tasks[tostring(id)].exit=tostring(err)
|
||||||
else
|
else
|
||||||
|
kernel.log("Task "..tostring(id).." exited with code: "..tostring(err), "INFO")
|
||||||
tasks[tostring(id)].status="Z"
|
tasks[tostring(id)].status="Z"
|
||||||
tasks[tostring(id)].exit=err
|
tasks[tostring(id)].exit=err
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
--:Minify:--
|
--:Minify:--
|
||||||
local kernel=...
|
local kernel=...
|
||||||
kernel.tty={}
|
kernel.tty={}
|
||||||
|
kernel.tty.inst={}
|
||||||
|
|
||||||
function kernel.tty.register(tty, ttyo)
|
function kernel.tty.register(tty, ttyo)
|
||||||
kernel.tty[tty]=ttyo
|
kernel.tty[tty]=ttyo
|
||||||
|
|||||||
Reference in New Issue
Block a user