DEBUGLOG = 1
if DEBUGLOG == 1 then
__print = print
local lfs = require("lfs")
local logPath = cc.FileUtils:getInstance():getWritablePath()
local targetPlatform = cc.Application:getInstance():getTargetPlatform()
if targetPlatform <= 3 then
logPath = logPath .. "zjh_log/"
lfs.mkdir(logPath)
local file = io.open(logPath .. string.gsub(os.date("%X"), "%p", "-") .. ".log", "w+")
file:setvbuf("no")
print = function ( ... )
table.insert(arg, 1, os.date("%X") .. " ")
for i,v in ipairs(arg) do
file:write( tostring(v) .. " " )
end
file:write("\n")
__print( unpack(arg) )
end
end
end
LUA LOG
最新推荐文章于 2024-08-31 07:51:10 发布