aboutsummaryrefslogtreecommitdiffstats
path: root/util-src
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-04-08 17:22:15 +0100
committerMatthew Wild <mwild1@gmail.com>2013-04-08 17:22:15 +0100
commit22baeb39fe3c291e7f98977b7fa6af8353d910dd (patch)
treeb63f60f6dff8c647f5952a2a92bb0a1da8d2a94f /util-src
parent4f4ea37379152abaee179a750a24f7019c405583 (diff)
parent0ce5c766ac0a68a167a9fa26b931c56d35ae785b (diff)
downloadprosody-22baeb39fe3c291e7f98977b7fa6af8353d910dd.tar.gz
prosody-22baeb39fe3c291e7f98977b7fa6af8353d910dd.zip
Merge 0.9->trunk
Diffstat (limited to 'util-src')
-rw-r--r--util-src/pposix.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/util-src/pposix.c b/util-src/pposix.c
index 99a308cf..f5cc8270 100644
--- a/util-src/pposix.c
+++ b/util-src/pposix.c
@@ -13,7 +13,7 @@
* POSIX support functions for Lua
*/
-#define MODULE_VERSION "0.3.5"
+#define MODULE_VERSION "0.3.6"
#include <stdlib.h>
#include <math.h>
@@ -204,12 +204,13 @@ int level_constants[] = {
};
int lc_syslog_log(lua_State* L)
{
- int level = luaL_checkoption(L, 1, "notice", level_strings);
- level = level_constants[level];
+ int level = level_constants[luaL_checkoption(L, 1, "notice", level_strings)];
- luaL_checkstring(L, 2);
+ if(lua_gettop(L) == 3)
+ syslog(level, "%s: %s", luaL_checkstring(L, 2), luaL_checkstring(L, 3));
+ else
+ syslog(level, "%s", lua_tostring(L, 2));
- syslog(level, "%s", lua_tostring(L, 2));
return 0;
}