diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-06-22 13:21:42 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-06-22 13:21:42 +0100 |
commit | 71620cbd9671248b3514d5988f8bb8a6d8d6f689 (patch) | |
tree | a79cc962d3da82e0205b12d77160f7b7af45562f /plugins | |
parent | ba4bd1e687fff494493a543e6c472ea272f4ec62 (diff) | |
parent | d869a898035d7bd35daa5ce6ef973747e31ce8fc (diff) | |
download | prosody-71620cbd9671248b3514d5988f8bb8a6d8d6f689.tar.gz prosody-71620cbd9671248b3514d5988f8bb8a6d8d6f689.zip |
Merge 0.10->trunk
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_admin_telnet.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 373ab81b..5bd32987 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -12,6 +12,7 @@ local hostmanager = require "core.hostmanager"; local modulemanager = require "core.modulemanager"; local s2smanager = require "core.s2smanager"; local portmanager = require "core.portmanager"; +local helpers = require "util.helpers"; local _G = _G; @@ -1168,6 +1169,26 @@ function def_env.http:list() return true; end +def_env.debug = {}; + +function def_env.debug:logevents(host) + helpers.log_host_events(host); + return true; +end + +function def_env.debug:events(host, event) + local events_obj; + if host and host ~= "*" then + if not hosts[host] then + return false, "Unknown host: "..host; + end + events_obj = hosts[host].events; + else + events_obj = prosody.events; + end + return true, helpers.show_events(events_obj, event); +end + module:hook("server-stopping", function(event) for conn, session in pairs(sessions) do session.print("Shutting down: "..(event.reason or "unknown reason")); |