直接放入Zframework文件
This commit is contained in:
20
Zframework/log.lua
Normal file
20
Zframework/log.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
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)
|
||||
print(message)
|
||||
log(message)
|
||||
end
|
||||
})
|
||||
|
||||
function LOG.read()
|
||||
return table.concat(logs,"\n")
|
||||
end
|
||||
|
||||
return LOG
|
||||
Reference in New Issue
Block a user