diff options
author | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2018-10-19 10:48:41 +0200 |
---|---|---|
committer | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2018-10-19 10:48:41 +0200 |
commit | d15210603f4654d20bc15be449cdc672dc4d53c5 (patch) | |
tree | 4a92f863e41a4ef528975f912039f5abab5063c7 /advtrains | |
parent | b03e402c718e8bc39d8aa57c5fe67c5722708c37 (diff) | |
download | advtrains-d15210603f4654d20bc15be449cdc672dc4d53c5.tar.gz advtrains-d15210603f4654d20bc15be449cdc672dc4d53c5.tar.bz2 advtrains-d15210603f4654d20bc15be449cdc672dc4d53c5.zip |
Move logging over to minetest log.
This should collaborate nicely with the system log rotate, in addition
to keeping everything in one place.
Diffstat (limited to 'advtrains')
-rw-r--r-- | advtrains/log.lua | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/advtrains/log.lua b/advtrains/log.lua index d2b71d3..2913904 100644 --- a/advtrains/log.lua +++ b/advtrains/log.lua @@ -3,11 +3,7 @@ advtrains.log = function() end if minetest.settings:get_bool("advtrains_enable_logging") then - advtrains.logfile = advtrains.fpath .. "_log" - function advtrains.log (event, player, pos, data) - local log = io.open(advtrains.logfile, "a+") - log:write(os.date()..": "..event.." by "..player.." at "..minetest.pos_to_string(pos).." -- "..(data or "").."\n") - log:close() + minetest.log("action", "advtrains: " ..event.." by "..player.." at "..minetest.pos_to_string(pos).." -- "..(data or "")) end end |