Software /
code /
prosody
Comparison
plugins/mod_posix.lua @ 728:fa45dfb27ee5
mod_posix: Check version of pposix
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 16 Jan 2009 05:18:38 +0000 |
parent | 723:c1e7d280c174 |
child | 734:cfb4ec5cba5e |
comparison
equal
deleted
inserted
replaced
727:78c9542de94e | 728:fa45dfb27ee5 |
---|---|
1 | |
2 local pposix_version = "0.3.0"; | |
1 | 3 |
2 local pposix = assert(require "util.pposix"); | 4 local pposix = assert(require "util.pposix"); |
5 if pposix._VERSION ~= want_pposix_version then log("warn", "Unknown version (%s) of binary pposix module, expected %s", tostring(pposix._VERSION), pposix_version); end | |
3 | 6 |
4 local config_get = require "core.configmanager".get; | 7 local config_get = require "core.configmanager".get; |
5 local logger_set = require "util.logger".setwriter; | 8 local logger_set = require "util.logger".setwriter; |
6 | 9 |
7 module.host = "*"; -- we're a global module | 10 module.host = "*"; -- we're a global module |
11 local logwriter; | 14 local logwriter; |
12 | 15 |
13 local logfilename = config_get("*", "core", "log"); | 16 local logfilename = config_get("*", "core", "log"); |
14 if logfilename == "syslog" then | 17 if logfilename == "syslog" then |
15 pposix.syslog_open("prosody"); | 18 pposix.syslog_open("prosody"); |
19 pposix.syslog_setminlevel(config.get("*", "core", "minimum_log_level") or "info"); | |
16 local syslog, format = pposix.syslog_log, string.format; | 20 local syslog, format = pposix.syslog_log, string.format; |
17 logwriter = function (name, level, message, ...) | 21 logwriter = function (name, level, message, ...) |
18 if ... then | 22 if ... then |
19 syslog(level, format(message, ...)); | 23 syslog(level, format(message, ...)); |
20 else | 24 else |