为什么trace中有些打印有"test"前缀,而有些打印没有前缀?

请先 登录 后评论

2 个回答

冷红林
擅长:互联网

如果加了test前缀,是因为重写了print函数。比如



--[[
函数名:print
功能 :打印接口,此文件中的所有打印都会加上test前缀
参数 :无
返回值:无
]]
local function print(...)
_G.print("test",...)
end

请先 登录 后评论
秦鹏 - Luat菜鸟

Q32

看这个文件里面的local function print函数重新封装了一个print函数, 加上了模块名的打印。

至于第二个问题,没打印“test”的时候,是因为找不到这个再封装的 print的定义,就按照原始的print打印。

请先 登录 后评论
  • 2 关注
  • 0 收藏,2118 浏览
  • qin0036 提出于 2018-08-24 06:45

相似问题