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 | 53d1a97ae3c688d20e8ce0a99a7acb2b0b3020e1 (patch) | |
tree | a79cc962d3da82e0205b12d77160f7b7af45562f | |
parent | e9adc7247f7aa880b0793a153c998dec9ee99f37 (diff) | |
parent | db6b2ff8f9fbb72bfa08cd5a6ff91abd30bbfe1c (diff) | |
download | prosody-53d1a97ae3c688d20e8ce0a99a7acb2b0b3020e1.tar.gz prosody-53d1a97ae3c688d20e8ce0a99a7acb2b0b3020e1.zip |
Merge 0.10->trunk
-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")); |