minetest-mods / moreblocks

More Blocks
https://content.minetest.net/packages/Calinou/moreblocks/
zlib License
45 stars 67 forks source link

amend load print #194

Closed Zweihorn closed 1 year ago

Zweihorn commented 1 year ago

Add a final print to log at the end of init.lua to indicate the mod was loaded successfully. This idea was derived from other mods which are specifically aimed at MT servers.

This could be useful not only for player support (e.g. in the MT forum) but would certainly be useful for MT server admins using the CLI and reading their server logs.

Calinou commented 1 year ago

I think this kind of verbose loading message ought to be something added to core Minetest, e.g. with a --verbose command line argument.

fluxionary commented 1 year ago
  1. in general, always use minetest.log, not print.
  2. the success and amount of time it takes to load a mod is already part of the info log-level stream. set debug_log_level = info in minetest.conf, or pass the --info argument to minetest when you launch it.
  3. --verbose already exists as well
Zweihorn commented 1 year ago

@fluxionary

From the start my PR was aiming at compatibility with legacy clients and servers. If you scan the MT forum you will become aware that there seem to be quite many MT 0.4 servers around which are actively used by many players.

However, the best solution may be this example of a new piece of improved code, if I understand the MT Lua code correctly.


-- print to log after mod was loaded successfully
local load_message = "[MOD] XXX loaded"
if minetest.log then
    minetest.log("info", load_message) -- aims at state of the art MT software
else
    print (load_message)  -- aims at legacy MT software used in the field
end

Hope this helps. I may provide a new PR in due time.

Zweihorn commented 1 year ago

I am quite aware that devs have the state of the art in their mind. However, as community effort MT projects including this mod should always have the majority of MT players in the field in their mind as long this would be reasonable, I presume.

IMHO it should be worth some consideration and would be quite unfortunate if too much MT server admins would become unhappy or loosing MT players.

Zweihorn commented 1 year ago

My apologies and obviously I made false assumptions.

closed