A simple log function that dumps the exents to a file log.txt

  AMS Code Snippets
-- Logs a event into log.txt if it exists
function log_deprecated(Function, Description)
-- if log.txt exists it logs the action, if not ignores the loging
if File.DoesExist(_SourceFolder .. "\\Data\\log.txt") == true then
local LogText = System.GetDate(DATE_FMT_ISO) .. " " .. System.GetTime(TIME_FMT_MIL) .. " " .. Function .. " -> " .. Description .. "\r\n";
TextFile.WriteFromString(_SourceFolder .. "\\Data\\log.txt", LogText, true);
end
end

LEAVE A COMMENT