Software /
code /
prosody
Comparison
plugins/mod_posix.lua @ 3540:bc139431830b
Monster whitespace commit (beware the whitespace monster).
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sat, 16 Oct 2010 23:00:42 +0500 |
parent | 3537:7bbb19804d82 |
child | 3555:6938b6153890 |
comparison
equal
deleted
inserted
replaced
3539:8bbd965267b2 | 3540:bc139431830b |
---|---|
109 end | 109 end |
110 end | 110 end |
111 end | 111 end |
112 end | 112 end |
113 | 113 |
114 local syslog_opened | 114 local syslog_opened; |
115 function syslog_sink_maker(config) | 115 function syslog_sink_maker(config) |
116 if not syslog_opened then | 116 if not syslog_opened then |
117 pposix.syslog_open("prosody"); | 117 pposix.syslog_open("prosody"); |
118 syslog_opened = true; | 118 syslog_opened = true; |
119 end | 119 end |
120 local syslog, format = pposix.syslog_log, string.format; | 120 local syslog, format = pposix.syslog_log, string.format; |
121 return function (name, level, message, ...) | 121 return function (name, level, message, ...) |
122 if ... then | 122 if ... then |
123 syslog(level, format(message, ...)); | 123 syslog(level, format(message, ...)); |
124 else | 124 else |
125 syslog(level, message); | 125 syslog(level, message); |
126 end | 126 end |
127 end; | 127 end; |
128 end | 128 end |
129 require "core.loggingmanager".register_sink_type("syslog", syslog_sink_maker); | 129 require "core.loggingmanager".register_sink_type("syslog", syslog_sink_maker); |
130 | 130 |
131 local daemonize = module:get_option("daemonize"); | 131 local daemonize = module:get_option("daemonize"); |
132 if daemonize == nil then | 132 if daemonize == nil then |