Replace print()s with minetest.log() in builtin
authorPilzAdam <pilzadam@minetest.net>
Sun, 17 Nov 2013 11:11:44 +0000 (12:11 +0100)
committerPilzAdam <pilzadam@minetest.net>
Sun, 17 Nov 2013 11:11:44 +0000 (12:11 +0100)
builtin/chatcommands.lua
builtin/modmgr.lua
builtin/serialize.lua

index 7d1c2b62a89672df0b582ff184b18bb74f4caa16..831d3a7b41e7d139787c9710500aec9d75e8033e 100644 (file)
@@ -471,10 +471,10 @@ minetest.register_chatcommand("spawnentity", {
                        minetest.chat_send_player(name, "entityname required")
                        return
                end
-               print('/spawnentity invoked, entityname="'..entityname..'"')
+               minetest.log("action", '/spawnentity invoked, entityname="'..entityname..'"')
                local player = minetest.get_player_by_name(name)
                if player == nil then
-                       print("Unable to spawn entity, player is nil")
+                       minetest.log("error", "Unable to spawn entity, player is nil")
                        return true -- Handled chat message
                end
                local p = player:getpos()
@@ -491,7 +491,7 @@ minetest.register_chatcommand("pulverize", {
        func = function(name, param)
                local player = minetest.get_player_by_name(name)
                if player == nil then
-                       print("Unable to pulverize, player is nil")
+                       minetest.log("error", "Unable to pulverize, player is nil")
                        return true -- Handled chat message
                end
                if player:get_wielded_item():is_empty() then
index 04f19ec86d4404bd453e5f3b9dbc8e46a82f7417..490336f06af26ede4e2c8b1f0e6aaa967ea14d7f 100644 (file)
@@ -778,7 +778,7 @@ function modmgr.handle_configure_world_buttons(fields)
                end
                
                if not worldfile:write() then
-                       print("failed to write world config file")
+                       minetest.log("error", "Failed to write world config file")
                end
                
                modmgr.modlist = nil
@@ -932,7 +932,7 @@ function modmgr.preparemodlist(data)
                        if element ~= nil then
                                element.enabled = engine.is_yes(value)
                        else
-                               print("Mod: " .. key .. " " .. dump(value) .. " but not found")
+                               minetest.log("info", "Mod: " .. key .. " " .. dump(value) .. " but not found")
                        end
                end
        end
index 61b923ce45a07dd85ab413b52ecbe6ba2ecd57de..165cc6731894e75ab89a7b72a18a4f34314b8541 100644 (file)
@@ -178,7 +178,7 @@ function minetest.deserialize(sdata)
        if okay then
                return results
        end
-       print('error:'.. results)
+       minetest.log('error', 'minetest.deserialize(): '.. results)
        return nil
 end