3 local tostring = tostring;
4 local filters
= require
"util.filters";
6 local function log_send(t
, session
)
7 if t
and t
~= "" and t
~= " " then
8 session
.log("debug", "SEND: %s", tostring(t
));
13 local function log_recv(t
, session
)
14 if t
and t
~= "" and t
~= " " then
15 session
.log("debug", "RECV: %s", tostring(t
));
20 local function init_raw_logging(session
)
21 filters
.add_filter(session
, "stanzas/in", log_recv
, -10000);
22 filters
.add_filter(session
, "stanzas/out", log_send
, 10000);
25 filters
.add_filter_hook(init_raw_logging
);
27 function module
.unload()
28 filters
.remove_filter_hook(init_raw_logging
);