DevTest: Move more logging to log mod

This commit is contained in:
Wuzzy 2022-10-08 17:46:03 +02:00 committed by sfan5
parent 48530ccbc0
commit 3a7fffc587
4 changed files with 15 additions and 9 deletions

@ -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)

@ -1,3 +1,16 @@
minetest.register_on_chatcommand(function(name, command, params)
minetest.log("action", "[devtest] Caught command '"..command.."', issued by '"..name.."'. Parameters: '"..params.."'")
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", prefix.."Caught command '"..command.."', issued by '"..name.."'. Parameters: '"..params.."'")
end)

Before

Width:  |  Height:  |  Size: 138 B

After

Width:  |  Height:  |  Size: 138 B