Software /
code /
prosody
Comparison
util/helpers.lua @ 1795:0e933d6f2c31
util.helpers: It would be a good idea to fire an event when we say we are
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 20 Sep 2009 03:20:38 +0100 |
parent | 1531:21051377f11b |
child | 1959:f56670ce64de |
comparison
equal
deleted
inserted
replaced
1794:218f720af304 | 1795:0e933d6f2c31 |
---|---|
12 end | 12 end |
13 logger = logger or log; | 13 logger = logger or log; |
14 name = name or tostring(events); | 14 name = name or tostring(events); |
15 function events.fire_event(event, ...) | 15 function events.fire_event(event, ...) |
16 logger("debug", "%s firing event: %s", name, event); | 16 logger("debug", "%s firing event: %s", name, event); |
17 return f(event, ...); | |
17 end | 18 end |
18 events[events.fire_event] = f; | 19 events[events.fire_event] = f; |
19 return events; | 20 return events; |
20 end | 21 end |
21 | 22 |