summaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/metadata_exporter.lua
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-11-25 21:53:42 +0200
committerAndrew Lewis <nerf@judo.za.org>2016-11-25 23:01:53 +0200
commitdf0b2a73076d9168698413d1322d680420d38016 (patch)
treee04979dd8f575945ace2bfd146a30a6d26da21e4 /src/plugins/lua/metadata_exporter.lua
parentc22f1ab8bb3cf373d515ae79888a6f5de87eca7b (diff)
downloadrspamd-df0b2a73076d9168698413d1322d680420d38016.tar.gz
rspamd-df0b2a73076d9168698413d1322d680420d38016.zip
[Minor] Use new API for debug logging in Lua plugins
Diffstat (limited to 'src/plugins/lua/metadata_exporter.lua')
-rw-r--r--src/plugins/lua/metadata_exporter.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/lua/metadata_exporter.lua b/src/plugins/lua/metadata_exporter.lua
index 6c77714a9..90d94a3e6 100644
--- a/src/plugins/lua/metadata_exporter.lua
+++ b/src/plugins/lua/metadata_exporter.lua
@@ -19,6 +19,7 @@ limitations under the License.
local rspamd_http
local rspamd_logger = require "rspamd_logger"
+local N = 'metadata_exporter'
local settings = {
format = function(task)
@@ -27,7 +28,7 @@ local settings = {
mime_type = 'text/plain',
}
-local opts = rspamd_config:get_all_opt('metadata_exporter')
+local opts = rspamd_config:get_all_opt(N)
if not opts then return end
local redis_params
local channel = opts['channel']
@@ -36,7 +37,7 @@ if not (url or channel) then
rspamd_logger.errx('No backends configured')
end
if channel then
- redis_params = rspamd_parse_redis_server('metadata_exporter')
+ redis_params = rspamd_parse_redis_server(N)
if not redis_params then
rspamd_logger.errx(rspamd_config, 'No redis servers are specified')
return
@@ -73,11 +74,11 @@ local function metadata_exporter(task)
end
if settings.select then
if not settings.select(task) then return end
- rspamd_logger.debugx(task, 'Message selected for processing')
+ rspamd_logger.debugm(N, task, 'Message selected for processing')
end
local data = settings.format(task)
if not data then
- rspamd_logger.debugx(task, 'Format returned non-truthy value: %1', data)
+ rspamd_logger.debugm(N, task, 'Format returned non-truthy value: %1', data)
return
end
if channel then