From 5b45f852163321547101ddb056bb7559b807c631 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 27 Apr 2013 09:48:35 +0800 Subject: [PATCH] [HelloLua] print ~> cclog --- samples/Lua/HelloLua/Resources/hello.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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)) ---------------