diff --git a/samples/Lua/HelloLua/Resources/hello.lua b/samples/Lua/HelloLua/Resources/hello.lua index 6e8ca376a0..d4e568acb5 100644 --- a/samples/Lua/HelloLua/Resources/hello.lua +++ b/samples/Lua/HelloLua/Resources/hello.lua @@ -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)) ---------------