aboutsummaryrefslogtreecommitdiffstats
path: root/core/loggingmanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-04-03 19:34:47 +0100
committerMatthew Wild <mwild1@gmail.com>2015-04-03 19:34:47 +0100
commit9ba4eef47c2806af0323f8ee215acfa16e49df57 (patch)
treeed4ed89ea492be641fddc99be7d2da14e5015e51 /core/loggingmanager.lua
parent12d6e03b5b62d8974f98492112a70fc754b5cb28 (diff)
parent4d46c2e86673dfb6d00865017929cf27e0aa22ac (diff)
downloadprosody-9ba4eef47c2806af0323f8ee215acfa16e49df57.tar.gz
prosody-9ba4eef47c2806af0323f8ee215acfa16e49df57.zip
Merge 0.10->trunk
Diffstat (limited to 'core/loggingmanager.lua')
-rw-r--r--core/loggingmanager.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/loggingmanager.lua b/core/loggingmanager.lua
index c6361146..f348dbdf 100644
--- a/core/loggingmanager.lua
+++ b/core/loggingmanager.lua
@@ -45,16 +45,16 @@ local logging_levels = { "debug", "info", "warn", "error" }
-- This function is called automatically when a new sink type is added [see apply_sink_rules()]
local function add_rule(sink_config)
local sink_maker = log_sink_types[sink_config.to];
- if sink_maker then
- -- Create sink
- local sink = sink_maker(sink_config);
+ if not sink_maker then
+ return; -- No such sink type
+ end
- -- Set sink for all chosen levels
- for level in pairs(get_levels(sink_config.levels or logging_levels)) do
- logger.add_level_sink(level, sink);
- end
- else
- -- No such sink type
+ -- Create sink
+ local sink = sink_maker(sink_config);
+
+ -- Set sink for all chosen levels
+ for level in pairs(get_levels(sink_config.levels or logging_levels)) do
+ logger.add_level_sink(level, sink);
end
end