Improve log messages (#422)

- Add log messages wherever required/useful
- Remove unnecessary log messages and print statements
- Convert print statements to minetest.log
- Fix incorrect log level for some messages
- Trivial code-style fixes
This commit is contained in:
ANAND 2019-10-18 11:22:18 +05:30 committed by GitHub
parent 21e7daa183
commit 5eb5d3311a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 71 additions and 49 deletions

View file

@ -11,6 +11,7 @@ local function add_irc_mod(name)
end
mods[#mods + 1] = name
storage:set_string("irc_mods", table.concat(mods, ","))
minetest.log("action", name .. " subscribed to IRC reports")
return true
end
@ -20,6 +21,7 @@ local function remove_irc_mod(name)
if idx > 0 then
table.remove(mods, idx)
storage:set_string("irc_mods", table.concat(mods, ","))
minetest.log("action", name .. " un-subscribed from IRC reports")
return true
end
return false
@ -36,6 +38,7 @@ minetest.register_chatcommand("report_sub", {
end
else
if add_irc_mod(name) then
minetest.log("action", name .. " subscribed to IRC reports")
return true, "Successfully added!"
else
return false, "Unable to add, are you already subscribed?"