自带的调试库支持设置调用钩子。
debug.sethook(hook_fun, "c")
如果第2个参数为空,则表示清除钩子。钩子中可以得到Luab函数名。
local function hook_fun()
local funcinfo = debug.getinfo(2, 'nS')
local name = funcinfo.name or 'anonymous'
local line = string.format("%d", funcinfo.linedefined or 0)
local source = funcinfo.short_src or 'C_FUNC'
local fun_name = string.format("%-30s: %s: %s", name, source, line)
skynet.error(fun_name)
end
博主真是太厉害了!!!
不错不错,我喜欢看
看的我热血沸腾啊https://www.237fa.com/
想想你的文章写的特别好https://www.ea55.com/
想想你的文章写的特别好www.jiwenlaw.com
兄弟写的非常好 https://www.cscnn.com/