json库会检测有LOG模块再LOG.print

This commit is contained in:
MrZ626
2021-03-05 00:30:17 +08:00
parent d58b7a9ff1
commit e5136dd2e5

View File

@@ -117,9 +117,8 @@ function json.encode(val)
local a,b=pcall(encode,val)
if a then
return b
else
elseif LOG then
LOG.print(text.jsonError..": "..(b or"uknErr"),"warn")
return
end
end
@@ -348,8 +347,7 @@ function json.decode(str)
local a,b=pcall(decode,str)
if a then
return b
else
elseif LOG then
LOG.print(text.jsonError..": "..(b or"uknErr"),"warn")
return
end
end