Skip to content

Commit

Permalink
DevTest: Move more logging to log mod
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuzzy2 authored and sfan5 committed Oct 23, 2022
1 parent 48530cc commit 3a7fffc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
7 changes: 0 additions & 7 deletions games/devtest/mods/experimental/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,4 @@ function experimental.print_to_everything(msg)
minetest.chat_send_all(msg)
end

minetest.log("info", "[experimental] modname="..dump(minetest.get_current_modname()))
minetest.log("info", "[experimental] modpath="..dump(minetest.get_modpath("experimental")))
minetest.log("info", "[experimental] worldpath="..dump(minetest.get_worldpath()))


minetest.register_on_mods_loaded(function()
minetest.log("action", "[experimental] on_mods_loaded()")
end)
15 changes: 14 additions & 1 deletion games/devtest/mods/log/init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
local modname = minetest.get_current_modname()
local prefix = "["..modname.."] "

-- Startup info
minetest.log("action", prefix.."modname="..dump(modname))
minetest.log("action", prefix.."modpath="..dump(minetest.get_modpath(modname)))
minetest.log("action", prefix.."worldpath="..dump(minetest.get_worldpath()))

-- Callback info
minetest.register_on_mods_loaded(function()
minetest.log("action", prefix.."Callback: on_mods_loaded()")
end)

minetest.register_on_chatcommand(function(name, command, params)
minetest.log("action", "[devtest] Caught command '"..command.."', issued by '"..name.."'. Parameters: '"..params.."'")
minetest.log("action", prefix.."Caught command '"..command.."', issued by '"..name.."'. Parameters: '"..params.."'")
end)
File renamed without changes.

0 comments on commit 3a7fffc

Please sign in to comment.