diff options
author | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2018-02-18 22:52:57 +0100 |
---|---|---|
committer | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2018-02-18 22:52:57 +0100 |
commit | 81d637dc76317df249a4d290006975141ab1a605 (patch) | |
tree | 0c5c4b22002ee4c6c6a620c1142225706a5a6283 /advtrains/log.lua | |
parent | 06cdb14f3d28780f011d842c17580c748d2020f2 (diff) | |
download | advtrains-81d637dc76317df249a4d290006975141ab1a605.tar.gz advtrains-81d637dc76317df249a4d290006975141ab1a605.tar.bz2 advtrains-81d637dc76317df249a4d290006975141ab1a605.zip |
added separate logging for railway networks
Diffstat (limited to 'advtrains/log.lua')
-rw-r--r-- | advtrains/log.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/advtrains/log.lua b/advtrains/log.lua new file mode 100644 index 0000000..827948f --- /dev/null +++ b/advtrains/log.lua @@ -0,0 +1,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 |