diff options
author | Kim Alvefur <zash@zash.se> | 2019-07-30 02:14:50 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-07-30 02:14:50 +0200 |
commit | a0c37efd1f7ef8b4e55ff8849076c2db2d442450 (patch) | |
tree | 314a49f63f508df6a9245609a935f9a8625b7dd1 /core/s2smanager.lua | |
parent | ad89e20a7c9647b8db78c3c7e3cec625dcd16f4c (diff) | |
download | prosody-a0c37efd1f7ef8b4e55ff8849076c2db2d442450.tar.gz prosody-a0c37efd1f7ef8b4e55ff8849076c2db2d442450.zip |
core.s2smanager: Rewrite log line to use formatting instead of concatenation
Makes it more in line with logging elsewhere. Potentially avoids or at
least delays creation of new string.
Diffstat (limited to 'core/s2smanager.lua')
-rw-r--r-- | core/s2smanager.lua | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua index 48bf0544..ccdf4932 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -9,8 +9,7 @@ local hosts = prosody.hosts; -local tostring, pairs, setmetatable - = tostring, pairs, setmetatable; +local pairs, setmetatable = pairs, setmetatable; local logger_init = require "util.logger".init; local sessionlib = require "util.session"; @@ -84,9 +83,8 @@ end local function destroy_session(session, reason) if session.destroyed then return; end - (session.log or log)("debug", "Destroying "..tostring(session.direction) - .." session "..tostring(session.from_host).."->"..tostring(session.to_host) - ..(reason and (": "..reason) or "")); + local log = session.log or log; + log("debug", "Destroying %s session %s->%s%s%s", session.direction, session.from_host, session.to_host, reason and ": " or "", reason or ""); if session.direction == "outgoing" then hosts[session.from_host].s2sout[session.to_host] = nil; |