aboutsummaryrefslogtreecommitdiff
path: root/advtrains/log.lua
blob: 827948f6c002b267d9149eda63076e708708cf20 (plain)
1
2
3
4
5
6
7
8
9
-- Log accesses to driver stands and changes to switches

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()
end