From d15210603f4654d20bc15be449cdc672dc4d53c5 Mon Sep 17 00:00:00 2001 From: Gabriel PĂ©rez-Cerezo Date: Fri, 19 Oct 2018 10:48:41 +0200 Subject: Move logging over to minetest log. This should collaborate nicely with the system log rotate, in addition to keeping everything in one place. --- advtrains/log.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'advtrains') 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 -- cgit v1.2.3