Page 1 of 1

[Discussion] Log after loading mods [Closed]

PostPosted: Sat Sep 29, 2012 12:28
by PilzAdam
Hello everyone!
Should mods print some message after loading?
Example:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.log("action", "[modname] loaded")


We should decide wether all mods should use this.

Result:
If "log_mods" in minetest.conf is set to true the mods will log that they have loaded.
Example code:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
if minetest.setting_get("log_mods") then
    minetest.log("action", "default loaded")
end

PostPosted: Sat Sep 29, 2012 12:40
by cornernote
As some of you have probably seen, I use this line, because it requires no editing between modules. Just paste at the bottom of your init.lua and it works:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.log("action", "[MOD]"..minetest.get_current_modname().." -- loaded from "..minetest.get_modpath(minetest.get_current_modname()))


We probably don't need to show the path, but its nice when you have loads of modpacks to see which one actually loaded.

I am +1 for a standard between all modders with this.

PostPosted: Sat Sep 29, 2012 14:43
by Calinou
IMO: we need an unified way of doing so. If a mod's init.lua contains "no_print_on_load = true" (or, there is a file named no_print_on_load.txt, in a similar way to modpack.txt), nothing is printed in the console when loaded, else "[<modname>] loaded." prints into console.

PostPosted: Sun Oct 07, 2012 17:18
by PilzAdam
Maybe
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
log_mods = true
in minetest.conf?