summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntumDeluge <antumdeluge@gmail.com>2017-07-05 14:53:09 -0700
committerDiego Martínez <kaeza@users.noreply.github.com>2017-07-08 10:25:51 -0300
commitd01a9c666f2d9f44a35562154ff86c7ce20e3e65 (patch)
tree36623281fddaf7446b7457260b00e544c217c394
parent0c308d02ac6b2be36793bd6e716ce3dbe85e61d0 (diff)
Print mod source that called deprecated `intllib.Getter`.
-rw-r--r--init.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index e98b5dd..b6cb1e9 100644
--- a/init.lua
+++ b/init.lua
@@ -65,8 +65,11 @@ end
function intllib.Getter(modname)
+ local info = debug and debug.getinfo and debug.getinfo(2)
+ local loc = info and info.short_src..":"..info.currentline
minetest.log("deprecated", "intllib.Getter is deprecated."
- .."Please use intllib.make_gettext_pair instead.")
+ .." Please use intllib.make_gettext_pair instead."
+ ..(info and " (called from "..loc..")" or "")
return Getter(modname)
end