Files
Elite-Gaming-FiveM/resources/cadvanced_mdt/server/lib/debug.lua
T
2021-12-03 01:19:31 +00:00

15 lines
520 B
Lua

function print_debug(content)
local conf = module("server/modules/config")
if conf.val("debug") then
local temp_file = state_get("temp_file")
print("CADVANCED SERVER: [ " .. temp_file .. " ] " .. content)
local fh = assert(io.open(temp_file, 'a'))
if (fh ~= nil) then
fh:write(os.date() .. " - " .. content .. "\n")
fh:close()
else
print("CADVANCED SERVER: CANNOT WRITE TO LOG FILE " .. fn)
print(fh)
end
end
end