# HG changeset patch # User Kim Alvefur # Date 1399465023 -7200 # Node ID 26a2092e289ff4b8335308fb527f8366b48fd593 # Parent 99cb06b31ae88839e310d464e86dae16b304bd52 mod_smacks: Log things attached to sessions instead of the module diff -r 99cb06b31ae8 -r 26a2092e289f mod_smacks/mod_smacks.lua --- a/mod_smacks/mod_smacks.lua Tue May 06 15:03:46 2014 +0200 +++ b/mod_smacks/mod_smacks.lua Wed May 07 14:17:03 2014 +0200 @@ -194,11 +194,11 @@ local handled_stanza_count = tonumber(stanza.attr.h)-origin.last_acknowledged_stanza; local queue = origin.outgoing_stanza_queue; if handled_stanza_count > #queue then - module:log("warn", "The client says it handled %d new stanzas, but we only sent %d :)", + session.log("warn", "The client says it handled %d new stanzas, but we only sent %d :)", handled_stanza_count, #queue); - module:log("debug", "Client h: %d, our h: %d", tonumber(stanza.attr.h), origin.last_acknowledged_stanza); + session.log("debug", "Client h: %d, our h: %d", tonumber(stanza.attr.h), origin.last_acknowledged_stanza); for i=1,#queue do - module:log("debug", "Q item %d: %s", i, tostring(queue[i])); + session.log("debug", "Q item %d: %s", i, tostring(queue[i])); end end for i=1,math_min(handled_stanza_count,#queue) do @@ -238,7 +238,7 @@ if not session.resumption_token then local queue = session.outgoing_stanza_queue; if #queue > 0 then - module:log("warn", "Destroying session with %d unacked stanzas", #queue); + session.log("warn", "Destroying session with %d unacked stanzas", #queue); handle_unacked_stanzas(session); end else