diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-08-16 21:34:53 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-08-16 21:34:53 +0100 |
commit | 4f3a0bf66da459d256a4cb9760157a3848df5b2d (patch) | |
tree | e11aee309a10ec09758801e1347e3122d78530ac | |
parent | 798c75481ecc618a53940e23a4c8c285e64088fc (diff) | |
download | prosody-4f3a0bf66da459d256a4cb9760157a3848df5b2d.tar.gz prosody-4f3a0bf66da459d256a4cb9760157a3848df5b2d.zip |
core.sessionmanager, xmppclient_listener: Move responsibility for setting session.log to the former from the latter, much more sensible
-rw-r--r-- | core/sessionmanager.lua | 6 | ||||
-rw-r--r-- | net/xmppclient_listener.lua | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index 1b1b36df..59f0eadf 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -19,7 +19,8 @@ local full_sessions = full_sessions; local bare_sessions = bare_sessions; local modulemanager = require "core.modulemanager"; -local log = require "util.logger".init("sessionmanager"); +local logger = require "util.logger"; +local log = logger.init("sessionmanager"); local error = error; local uuid_generate = require "util.uuid".generate; local rm_load_roster = require "core.rostermanager".load_roster; @@ -50,6 +51,9 @@ function new_session(conn) local w = conn.write; session.send = function (t) w(tostring(t)); end session.ip = conn.ip(); + local conn_name = "c2s"..tostring(conn):match("[a-f0-9]+$"); + session.log = logger.init(conn_name); + return session; end diff --git a/net/xmppclient_listener.lua b/net/xmppclient_listener.lua index dcc561f3..0ef49e8c 100644 --- a/net/xmppclient_listener.lua +++ b/net/xmppclient_listener.lua @@ -116,9 +116,6 @@ function xmppclient.listener(conn, data) -- Logging functions -- - local conn_name = "c2s"..tostring(conn):match("[a-f0-9]+$"); - session.log = logger.init(conn_name); - session.log("info", "Client connected"); -- Client is using legacy SSL (otherwise mod_tls sets this flag) |