aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2018-10-19 10:48:41 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2018-10-19 10:48:41 +0200
commitd15210603f4654d20bc15be449cdc672dc4d53c5 (patch)
tree4a92f863e41a4ef528975f912039f5abab5063c7
parentb03e402c718e8bc39d8aa57c5fe67c5722708c37 (diff)
downloadadvtrains-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.
-rw-r--r--advtrains/log.lua6
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