Merge pull request #2468 from dumganhar/master

[HelloLua] print ~> cclog
This commit is contained in:
James Chen 2013-04-26 18:50:07 -07:00
commit eeb1965710
1 changed files with 10 additions and 5 deletions

View File

@ -1,9 +1,14 @@
-- cclog
cclog = function(...)
print(string.format(...))
end
-- for CCLuaEngine traceback
function __G__TRACKBACK__(msg)
print("----------------------------------------")
print("LUA ERROR: " .. tostring(msg) .. "\n")
print(debug.traceback())
print("----------------------------------------")
cclog("----------------------------------------")
cclog("LUA ERROR: " .. tostring(msg) .. "\n")
cclog(debug.traceback())
cclog("----------------------------------------")
end
local function main()
@ -12,7 +17,7 @@ local function main()
collectgarbage("setstepmul", 5000)
require "hello2"
print("result is " .. myadd(1, 1))
cclog("result is " .. myadd(1, 1))
---------------