mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
add new debug command trace
This commit is contained in:
@@ -158,6 +158,7 @@ function COMMAND.help()
|
||||
shrtbl = "Show shared short string table info",
|
||||
ping = "ping address",
|
||||
call = "call address ...",
|
||||
trace = "trace address [proto] [on|off]",
|
||||
}
|
||||
end
|
||||
|
||||
@@ -343,6 +344,22 @@ function COMMAND.ping(address)
|
||||
return tostring(ti)
|
||||
end
|
||||
|
||||
local function toboolean(x)
|
||||
return x and (x == "true" or x == "on")
|
||||
end
|
||||
|
||||
function COMMAND.trace(address, proto, flag)
|
||||
address = adjust_address(address)
|
||||
if flag == nil then
|
||||
if proto == "on" or proto == "off" then
|
||||
proto = toboolean(proto)
|
||||
end
|
||||
else
|
||||
flag = toboolean(flag)
|
||||
end
|
||||
skynet.call(address, "debug", "TRACELOG", proto, flag)
|
||||
end
|
||||
|
||||
function COMMANDX.call(cmd)
|
||||
local address = adjust_address(cmd[2])
|
||||
local cmdline = assert(cmd[1]:match("%S+%s+%S+%s(.+)") , "need arguments")
|
||||
|
||||
Reference in New Issue
Block a user