Mercurial > prosody-hg
comparison plugins/mod_stanza_debug.lua @ 10111:0f335815244f
plugins: Remove tostring call from logging
Taken care of by loggingmanager now
Mass-rewrite using lua pattern like `tostring%b()`
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 30 Jul 2019 02:29:36 +0200 |
| parents | c3de5b454ec4 |
| children | 74b9e05af71e |
comparison
equal
deleted
inserted
replaced
| 10110:3fa3872588a8 | 10111:0f335815244f |
|---|---|
| 1 module:set_global(); | 1 module:set_global(); |
| 2 | 2 |
| 3 local tostring = tostring; | |
| 4 local filters = require "util.filters"; | 3 local filters = require "util.filters"; |
| 5 | 4 |
| 6 local function log_send(t, session) | 5 local function log_send(t, session) |
| 7 if t and t ~= "" and t ~= " " then | 6 if t and t ~= "" and t ~= " " then |
| 8 session.log("debug", "SEND: %s", tostring(t)); | 7 session.log("debug", "SEND: %s", t); |
| 9 end | 8 end |
| 10 return t; | 9 return t; |
| 11 end | 10 end |
| 12 | 11 |
| 13 local function log_recv(t, session) | 12 local function log_recv(t, session) |
| 14 if t and t ~= "" and t ~= " " then | 13 if t and t ~= "" and t ~= " " then |
| 15 session.log("debug", "RECV: %s", tostring(t)); | 14 session.log("debug", "RECV: %s", t); |
| 16 end | 15 end |
| 17 return t; | 16 return t; |
| 18 end | 17 end |
| 19 | 18 |
| 20 local function init_raw_logging(session) | 19 local function init_raw_logging(session) |
