Diff

plugins/mod_posix.lua @ 8235:7d9a2c200736

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Thu, 14 Sep 2017 02:48:34 +0200
parent 8168:45be94611593
parent 8228:cda9db4b881d
child 8663:a7a9d9511dc1
line wrap: on
line diff
--- a/plugins/mod_posix.lua	Wed Sep 13 18:46:39 2017 +0200
+++ b/plugins/mod_posix.lua	Thu Sep 14 02:48:34 2017 +0200
@@ -20,6 +20,7 @@
 	module:log("warn", "Couldn't load signal library, won't respond to SIGTERM");
 end
 
+local format = require "util.format".format;
 local lfs = require "lfs";
 local stat = lfs.attributes;
 
@@ -118,13 +119,9 @@
 		pposix.syslog_open("prosody", module:get_option_string("syslog_facility"));
 		syslog_opened = true;
 	end
-	local syslog, format = pposix.syslog_log, string.format;
+	local syslog = pposix.syslog_log;
 	return function (name, level, message, ...)
-		if ... then
-			syslog(level, name, format(message, ...));
-		else
-			syslog(level, name, message);
-		end
+		syslog(level, name, format(message, ...));
 	end;
 end
 require "core.loggingmanager".register_sink_type("syslog", syslog_sink_maker);