Replace excessive use of print with minetest.log

master
Wuzzy 2017-12-14 18:37:31 +01:00
parent d2adcc5206
commit 51bc9a2946
13 changed files with 19 additions and 18 deletions

View File

@ -18,6 +18,9 @@ if not groups then
groups = minetest.registered_items[craft].groups
end
groups.not_in_creative_inventory = 1
groups.wood = nil
groups.wool = nil
groups.stone = nil
if not sounds then
sounds = minetest.registered_items[craft].sounds

View File

@ -65,7 +65,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
local t1 = os.clock()
local x0 = minp.x
local z0 = minp.z
print ("[highlandpools] chunk ("..x0.." "..y0.." "..z0..")")
minetest.log("verbose", "[highlandpools] chunk ("..x0.." "..y0.." "..z0..")")
local x1 = maxp.x
local y1 = maxp.y
local z1 = maxp.z
@ -257,5 +257,5 @@ minetest.register_on_generated(function(minp, maxp, seed)
local chugent = math.ceil((os.clock() - t1) * 1000)
print ("[highlandpools] time "..chugent.." ms")
minetest.log("verbose", "[highlandpools] time "..chugent.." ms")
end)

View File

@ -65,7 +65,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
local t1 = os.clock()
local x0 = minp.x
local z0 = minp.z
print ("[highlandpools2] chunk ("..x0.." "..y0.." "..z0..")")
minetest.log("verbose", "[highlandpools2] chunk ("..x0.." "..y0.." "..z0..")")
local x1 = maxp.x
local y1 = maxp.y
local z1 = maxp.z
@ -257,5 +257,5 @@ minetest.register_on_generated(function(minp, maxp, seed)
local chugent = math.ceil((os.clock() - t1) * 1000)
print ("[highlandpools2] time "..chugent.." ms")
minetest.log("verbose", "[highlandpools2] time "..chugent.." ms")
end)

View File

@ -132,7 +132,7 @@ function mesecon:receptor_off(pos, rules)
end
print("[OK] Mesecons")
minetest.log("action", "[OK] Mesecons")
--The actual wires
dofile(minetest.get_modpath("mesecons").."/wires.lua");

View File

@ -496,7 +496,7 @@ local yaw = 0
end
elseif self.state == "attack" and self.attack_type == "dogfight" then
if not self.attack.player or not self.attack.player:getpos() then
print("stop attacking")
minetest.log("verbose", "[mobs] Mob stopped attacking")
self.state = "stand"
self:set_animation("stand")
return

View File

@ -124,5 +124,5 @@ if pipeworks.enable_node_breaker then dofile(pipeworks.modpath.."/node_breaker.l
minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty")
print("Pipeworks loaded!")
minetest.log("action", "Pipeworks loaded!")

View File

@ -542,4 +542,4 @@ minetest.register_alias("flowers:cotton", "farming:string")
minetest.register_alias("flowers:cotton_wad", "farming:string")
print(S("[Flowers] Loaded."))
minetest.log("action", S("[Flowers] Loaded."))

View File

@ -32,7 +32,6 @@ local DEBUG = false --... except if you want to spam the console with debugging
function plantslib:dbg(msg)
if DEBUG then
print("[Plantlife] "..msg)
minetest.log("verbose", "[Plantlife] "..msg)
end
end
@ -609,4 +608,4 @@ end
print(S("[Plantlife Library] Loaded"))
minetest.log("action", S("[Plantlife Library] Loaded"))

View File

@ -107,4 +107,4 @@ plantslib:grow_plants({
ground_nodes = {"default:dirt_with_grass"}
})
print(S("[Poison Ivy] Loaded."))
minetest.log("action", S("[Poison Ivy] Loaded."))

View File

@ -598,7 +598,6 @@ function signs_lib.determine_sign_type(itemstack, placer, pointed_thing, locked)
local fdir = minetest.dir_to_facedir(dir)
local pt_name = minetest.get_node(under).name
print(dump(pt_name))
local signname = itemstack:get_name()
if fences_with_sign[pt_name] and signname == "default:sign_wall" then
@ -954,7 +953,7 @@ function signs_lib.register_fence_with_sign(fencename, fencewithsignname)
minetest.register_node(":"..fencename, def)
minetest.register_node(":"..fencewithsignname, def_sign)
table.insert(signs_lib.sign_node_list, fencewithsignname)
print(S("Registered %s and %s"):format(fencename, fencewithsignname))
minetest.log("action", "[signs_lib] "..S("Registered %s and %s"):format(fencename, fencewithsignname))
end
build_char_db()

View File

@ -78,7 +78,7 @@ travelnet.save_data = function()
file:write( data );
file:close();
else
print("[Mod travelnet] Error: Savefile '"..tostring( path ).."' could not be written.");
minetest.log("error", "[travelnet] Error: Savefile '"..tostring( path ).."' could not be written.");
end
end
@ -93,7 +93,7 @@ travelnet.restore_data = function()
travelnet.targets = minetest.deserialize( data );
file:close();
else
print("[Mod travelnet] Error: Savefile '"..tostring( path ).."' not found.");
minetest.log("error", "[travelnet] Error: Savefile '"..tostring( path ).."' not found.");
end
end

View File

@ -442,4 +442,4 @@ if minetest.get_modpath("moreblocks") and ENABLE_STAIRSPLUS then
)
table.insert(circular_saw.known_stairs, "vines:vines_block")
end
print("[Vines] Loaded!")
minetest.log("action", "[vines] Loaded!")

View File

@ -92,7 +92,7 @@ end
zcg.need_load_all = true
zcg.load_all = function()
print("Loading all crafts, this may take some time...")
minetest.log("action", "[zcg]", "Loading all crafts, this may take some time...")
local i = 0
for name, item in pairs(minetest.registered_items) do
if (name and name ~= "") then
@ -102,7 +102,7 @@ zcg.load_all = function()
end
table.sort(zcg.itemlist)
zcg.need_load_all = false
print("All crafts loaded !")
minetest.log("action", "[zcg] All crafts loaded !")
end
zcg.formspec = function(pn)