mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-16 16:11:06 +01:00
Add default logger to make logging easier
This commit is contained in:
parent
814ad39c09
commit
ff0fea8978
1 changed files with 13 additions and 0 deletions
|
@ -22,6 +22,19 @@ function table.update_nil(t, ...)
|
|||
return t
|
||||
end
|
||||
|
||||
local LOGGING_ON = minetest.settings:get_bool("mcl_logging_default",false)
|
||||
local LOG_MODULE = "[MCL2]"
|
||||
function mcl_util.mcl_log (message, module)
|
||||
local selected_module = LOG_MODULE
|
||||
if module then
|
||||
selected_module = module
|
||||
end
|
||||
if LOGGING_ON and message then
|
||||
minetest.log(selected_module .. " " .. message)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function mcl_util.file_exists(name)
|
||||
if type(name) ~= "string" then return end
|
||||
local f = io.open(name)
|
||||
|
|
Loading…
Reference in a new issue