comparison mod_admin_web/admin_web/mod_admin_web.lua @ 3567:179424d557f2

mod_admin_web: Fix to use format strings in logger calls (thanks Ge0rG)
author Matthew Wild <mwild1@gmail.com>
date Tue, 30 Apr 2019 10:45:00 +0100
parents 8079e9c6d419
children a8aacfbdaea9
comparison
equal deleted inserted replaced
3566:b50be75c8bef 3567:179424d557f2
54 end 54 end
55 if session.compressed then 55 if session.compressed then
56 item:tag("compressed"):up(); 56 item:tag("compressed"):up();
57 end 57 end
58 service[host]:publish(xmlns_c2s_session, host, id, item); 58 service[host]:publish(xmlns_c2s_session, host, id, item);
59 module:log("debug", "Added client " .. name); 59 module:log("debug", "Added client %s", name);
60 end 60 end
61 61
62 local function del_client(session, host) 62 local function del_client(session, host)
63 local name = session.full_jid; 63 local name = session.full_jid;
64 local id = idmap[name]; 64 local id = idmap[name];
94 end 94 end
95 if session.compressed then 95 if session.compressed then
96 item:tag("compressed"):up(); 96 item:tag("compressed"):up();
97 end 97 end
98 service[host]:publish(xmlns_s2s_session, host, id, item); 98 service[host]:publish(xmlns_s2s_session, host, id, item);
99 module:log("debug", "Added host " .. name .. " s2s" .. type); 99 module:log("debug", "Added host %s s2s%s", name, type);
100 end 100 end
101 101
102 local function del_host(session, type, host) 102 local function del_host(session, type, host)
103 local name = (type == "out" and session.to_host) or (type == "in" and session.from_host); 103 local name = (type == "out" and session.to_host) or (type == "in" and session.from_host);
104 local id = idmap[name.."_"..type]; 104 local id = idmap[name.."_"..type];
217 }); 217 });
218 218
219 -- Create node for s2s sessions 219 -- Create node for s2s sessions
220 local ok, err = service[module.host]:create(xmlns_s2s_session, true); 220 local ok, err = service[module.host]:create(xmlns_s2s_session, true);
221 if not ok then 221 if not ok then
222 module:log("warn", "Could not create node " .. xmlns_s2s_session .. ": " .. tostring(err)); 222 module:log("warn", "Could not create node %s: %s", xmlns_s2s_session, err);
223 else 223 else
224 service[module.host]:set_affiliation(xmlns_s2s_session, true, module.host, "owner") 224 service[module.host]:set_affiliation(xmlns_s2s_session, true, module.host, "owner")
225 end 225 end
226 226
227 -- Add outgoing s2s sessions 227 -- Add outgoing s2s sessions
239 end 239 end
240 240
241 -- Create node for c2s sessions 241 -- Create node for c2s sessions
242 ok, err = service[module.host]:create(xmlns_c2s_session, true); 242 ok, err = service[module.host]:create(xmlns_c2s_session, true);
243 if not ok then 243 if not ok then
244 module:log("warn", "Could not create node " .. xmlns_c2s_session .. ": " .. tostring(err)); 244 module:log("warn", "Could not create node %s: %s", xmlns_c2s_session, tostring(err));
245 else 245 else
246 service[module.host]:set_affiliation(xmlns_c2s_session, true, module.host, "owner") 246 service[module.host]:set_affiliation(xmlns_c2s_session, true, module.host, "owner")
247 end 247 end
248 248
249 -- Add c2s sessions 249 -- Add c2s sessions