Software /
code /
prosody
Diff
core/sessionmanager.lua @ 1684:645e18990211
core.sessionmanager, xmppclient_listener: Move responsibility for setting session.log to the former from the latter, much more sensible
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 16 Aug 2009 21:34:53 +0100 |
parent | 1523:841d61be198f |
child | 1872:1905eca82ddf |
line wrap: on
line diff
--- a/core/sessionmanager.lua Sun Aug 16 21:32:10 2009 +0100 +++ b/core/sessionmanager.lua Sun Aug 16 21:34:53 2009 +0100 @@ -19,7 +19,8 @@ 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 @@ 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