aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-05-07 16:02:29 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-05-07 16:02:29 +0500
commit43658f9669a5a3566bdf12e81b3793fdecacf4eb (patch)
tree43e6086f3faaadf8d9203bb9b4a724443af3299a /prosody
parent5394f55419896520bd65088e5e71078006478e9c (diff)
downloadprosody-43658f9669a5a3566bdf12e81b3793fdecacf4eb.tar.gz
prosody-43658f9669a5a3566bdf12e81b3793fdecacf4eb.zip
prosody: Modified function metatable for better string representation of functions.
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody4
1 files changed, 4 insertions, 0 deletions
diff --git a/prosody b/prosody
index 0232b83b..e4e82105 100755
--- a/prosody
+++ b/prosody
@@ -143,6 +143,10 @@ function set_function_metatable()
debug.setupvalue(f, i, value);
end
end
+ function mt.__tostring(f)
+ local info = debug.getinfo(f);
+ return ("function(%s:%d)"):format(info.short_src:match("[^\\/]*$"), info.linedefined);
+ end
debug.setmetatable(function() end, mt);
end