aboutsummaryrefslogtreecommitdiffstats
path: root/core/loggingmanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-04-21 21:11:12 +0100
committerMatthew Wild <mwild1@gmail.com>2009-04-21 21:11:12 +0100
commit84bdf9494c891172c03f81186e0e8ff1a39364d7 (patch)
treee1f964cc5b90e08413fa29bec892edd24b66ec37 /core/loggingmanager.lua
parenta4889cee50d71f5e4406bf6e6c054e16b307379a (diff)
parent7f18f6d4a74a1578155b42b0ff15d8e59b53b9b2 (diff)
downloadprosody-84bdf9494c891172c03f81186e0e8ff1a39364d7.tar.gz
prosody-84bdf9494c891172c03f81186e0e8ff1a39364d7.zip
Merge with 0.4.1
Diffstat (limited to 'core/loggingmanager.lua')
-rw-r--r--core/loggingmanager.lua14
1 files changed, 11 insertions, 3 deletions
diff --git a/core/loggingmanager.lua b/core/loggingmanager.lua
index bf800020..53ebb99b 100644
--- a/core/loggingmanager.lua
+++ b/core/loggingmanager.lua
@@ -8,12 +8,15 @@ local math_max = math.max;
local logger = require "util.logger";
+local default_logging = { { to = "console" } };
+
-- Global log function, because some people are too
-- lazy to get their own...
_G.log = logger.init("general");
local log_sink_types = {};
local get_levels;
+local logging_levels = { "debug", "info", "warn", "error", "critical" }
--- Main function to read config, create the appropriate sinks and tell logger module
function setup_logging(log)
@@ -47,7 +50,14 @@ function setup_logging(log)
end
end);
else
- -- All sources
+ -- All sources
+ -- Create sink
+ local sink = sink_maker(sink_config);
+
+ -- Set sink for all levels
+ for _, level in pairs(logging_levels) do
+ logger.add_level_sink(level, sink);
+ end
end
else
-- No such sink type
@@ -129,8 +139,6 @@ function log_sink_types.syslog()
end
--- Helper function to get a set of levels given a "criteria" table
-local logging_levels = { "debug", "info", "warn", "error", "critical" }
-
function get_levels(criteria, set)
set = set or {};
if type(criteria) == "string" then