Software /
code /
prosody
Changeset
3404:33c81ee280e3
mod_console: Added support for multiple arguments to print().
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Mon, 26 Jul 2010 00:59:26 +0500 |
parents | 3403:b89680015b7b |
children | 3405:b1efe62c3c37 |
files | plugins/mod_console.lua |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_console.lua Mon Jul 26 00:58:19 2010 +0500 +++ b/plugins/mod_console.lua Mon Jul 26 00:59:26 2010 +0500 @@ -36,7 +36,13 @@ local w = function(s) conn:write(s:gsub("\n", "\r\n")); end; local session = { conn = conn; send = function (t) w(tostring(t)); end; - print = function (t) w("| "..tostring(t).."\n"); end; + print = function (...) + local t = {}; + for i=1,select("#", ...) do + t[i] = tostring(select(i, ...)); + end + w("| "..table.concat(t, "\t").."\n"); + end; disconnect = function () conn:close(); end; }; session.env = setmetatable({}, default_env_mt);