forked from Mirrorlandia_minetest/mod-sneeker
Add debugging setting & log method
This commit is contained in:
parent
3f835fa65d
commit
604eb77dc7
9
init.lua
9
init.lua
@ -5,11 +5,18 @@ sneaker = {}
|
|||||||
sneaker.modname = minetest.get_current_modname()
|
sneaker.modname = minetest.get_current_modname()
|
||||||
sneaker.modpath = minetest.get_modpath(sneaker.modname)
|
sneaker.modpath = minetest.get_modpath(sneaker.modname)
|
||||||
|
|
||||||
|
sneaker.debug = minetest.setting_get('sneaker_debug') or false
|
||||||
|
sneaker.spawn_cap = minetest.setting_get('sneaker_spawn_cap') or 50
|
||||||
|
|
||||||
function sneaker.log(message)
|
function sneaker.log(message)
|
||||||
minetest.log('action', '[' .. sneaker.modname .. '] ' .. message)
|
minetest.log('action', '[' .. sneaker.modname .. '] ' .. message)
|
||||||
end
|
end
|
||||||
|
|
||||||
sneaker.spawn_cap = minetest.setting_get('sneaker_spawn_cap') or 50
|
function sneaker.log_debug(message)
|
||||||
|
if sneaker.debug then
|
||||||
|
sneaker.log('[DEBUG] ' .. message)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if minetest.setting_getbool('log_mods') then
|
if minetest.setting_getbool('log_mods') then
|
||||||
minetest.log('action', 'Loading mod "' .. sneaker.modname .. '" ...')
|
minetest.log('action', 'Loading mod "' .. sneaker.modname .. '" ...')
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
# Logs debug output.
|
||||||
|
sneaker_debug (Log debug output) bool false
|
||||||
|
|
||||||
# Sets maximum number of spawns that can exist in world.
|
# Sets maximum number of spawns that can exist in world.
|
||||||
sneaker_spawn_cap (Maximum spawns) int 50
|
sneaker_spawn_cap (Maximum spawns) int 50
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user