diff options
author | Matthew Wild <mwild1@gmail.com> | 2013-04-08 17:22:15 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2013-04-08 17:22:15 +0100 |
commit | 94b629076096ad83c60c01af607d3aee160584b4 (patch) | |
tree | b63f60f6dff8c647f5952a2a92bb0a1da8d2a94f /util-src/pposix.c | |
parent | 308088b1faaf9a50df3432378e0bc4be52b35ab3 (diff) | |
parent | 7e9a5cc5a36ae7d653836615143b5a78a505bfed (diff) | |
download | prosody-94b629076096ad83c60c01af607d3aee160584b4.tar.gz prosody-94b629076096ad83c60c01af607d3aee160584b4.zip |
Merge 0.9->trunk
Diffstat (limited to 'util-src/pposix.c')
-rw-r--r-- | util-src/pposix.c | 11 |
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; } |