Software /
code /
prosody
Comparison
net/connlisteners.lua @ 1099:127e6ae089f8
net.connlisteners: Lower log level of multiple listeners warning (not interesting to end-users)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 03 May 2009 01:10:49 +0100 |
parent | 908:b0ecd18e0558 |
child | 1523:841d61be198f |
comparison
equal
deleted
inserted
replaced
1098:37ea264e133d | 1099:127e6ae089f8 |
---|---|
19 | 19 |
20 local listeners = {}; | 20 local listeners = {}; |
21 | 21 |
22 function register(name, listener) | 22 function register(name, listener) |
23 if listeners[name] and listeners[name] ~= listener then | 23 if listeners[name] and listeners[name] ~= listener then |
24 log("warn", "Listener %s is already registered, not registering any more", name); | 24 log("debug", "Listener %s is already registered, not registering any more", name); |
25 return false; | 25 return false; |
26 end | 26 end |
27 listeners[name] = listener; | 27 listeners[name] = listener; |
28 log("info", "Registered connection listener %s", name); | 28 log("debug", "Registered connection listener %s", name); |
29 return true; | 29 return true; |
30 end | 30 end |
31 | 31 |
32 function deregister(name) | 32 function deregister(name) |
33 listeners[name] = nil; | 33 listeners[name] = nil; |