aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/s2smanager.lua1
-rw-r--r--core/sessionmanager.lua6
2 files changed, 6 insertions, 1 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index 0589e024..ab2e4a5c 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -126,6 +126,7 @@ function new_incoming(conn)
end
open_sessions = open_sessions + 1;
local w, log = conn.write, logger_init("s2sin"..tostring(conn):match("[a-f0-9]+$"));
+ session.log = log;
session.sends2s = function (t) log("debug", "sending: %s", tostring(t)); w(tostring(t)); end
incoming_s2s[session] = true;
return session;
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