1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Refactor logging

- Add warning log level
- Change debug_log_level setting to enumeration string
- Map Irrlicht log events to MT log events
- Encapsulate log_* functions and global variables into a class, Logger
- Unify dstream with standard logging mechanism
- Unify core.debug() with standard core.log() script API
This commit is contained in:
ShadowNinja 2015-10-13 03:57:44 -04:00 committed by kwolekr
parent e0b57c1140
commit 2139d7d45f
25 changed files with 599 additions and 652 deletions

View file

@ -4,8 +4,7 @@
-- Default material types
--
local function digprop_err()
core.log("info", debug.traceback())
core.log("info", "WARNING: The core.digprop_* functions are obsolete and need to be replaced by item groups.")
core.log("deprecated", "The core.digprop_* functions are obsolete and need to be replaced by item groups.")
end
core.digprop_constanttime = digprop_err
@ -16,12 +15,12 @@ core.digprop_woodlike = digprop_err
core.digprop_leaveslike = digprop_err
core.digprop_glasslike = digprop_err
core.node_metadata_inventory_move_allow_all = function()
core.log("info", "WARNING: core.node_metadata_inventory_move_allow_all is obsolete and does nothing.")
function core.node_metadata_inventory_move_allow_all()
core.log("deprecated", "core.node_metadata_inventory_move_allow_all is obsolete and does nothing.")
end
core.add_to_creative_inventory = function(itemstring)
core.log('info', "WARNING: core.add_to_creative_inventory: This function is deprecated and does nothing.")
function core.add_to_creative_inventory(itemstring)
core.log("deprecated", "core.add_to_creative_inventory: This function is deprecated and does nothing.")
end
--
@ -32,7 +31,7 @@ local envref_deprecation_message_printed = false
setmetatable(core.env, {
__index = function(table, key)
if not envref_deprecation_message_printed then
core.log("info", "WARNING: core.env:[...] is deprecated and should be replaced with core.[...]")
core.log("deprecated", "core.env:[...] is deprecated and should be replaced with core.[...]")
envref_deprecation_message_printed = true
end
local func = core[key]