Created
December 8, 2020 01:00
-
-
Save rockerBOO/8f4c41b71a95d434ec5eae0e4386747d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Very simple file logger for lua | |
-- local log = log_to_file('mylogfile.log') | |
-- log('my string') | |
local log_to_file = function(logfile) | |
return function(log) | |
local file = io.open(logfile, "a") | |
if not file then return end | |
file:write(log .. "\n") | |
file:close() | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment