添加log模块,用于代替之前缺少音频文件弹出的消息框
也给缺少图片和加载错误语言等地方添加了日志 控制台添加log命令输出日志
This commit is contained in:
19
Zframework/log.lua
Normal file
19
Zframework/log.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
local ins=table.insert
|
||||
|
||||
local logs={os.date("Techmino logs %Y/%m/%d %A")}
|
||||
|
||||
local function log(message)
|
||||
ins(logs,os.date("%H:%M:%S")..message)
|
||||
end
|
||||
|
||||
local LOG=setmetatable({logs=logs},{
|
||||
__call=function(_,message)
|
||||
log(message)
|
||||
end
|
||||
})
|
||||
|
||||
function LOG.read()
|
||||
return table.concat(logs,"\n")
|
||||
end
|
||||
|
||||
return LOG
|
||||
Reference in New Issue
Block a user