moduleapi: in module:provides(), add the name of the module in item._provided_by
[prosody.git] / core / loggingmanager.lua
index 56a3ee2c10640dd53eb2591ff04c6fbc0bcb18e8..c69dede85edf747d4c5f935f99fea5b06887d72a 100644 (file)
@@ -7,14 +7,12 @@
 --
 
 
-local format, rep = string.format, string.rep;
-local pcall = pcall;
-local debug = debug;
-local tostring, setmetatable, rawset, pairs, ipairs, type =
-       tostring, setmetatable, rawset, pairs, ipairs, type;
+local format = string.format;
+local setmetatable, rawset, pairs, ipairs, type =
+       setmetatable, rawset, pairs, ipairs, type;
 local io_open, io_write = io.open, io.write;
 local math_max, rep = math.max, string.rep;
-local os_date, os_getenv = os.date, os.getenv;
+local os_date = os.date;
 local getstyle, setstyle = require "util.termcolours".getstyle, require "util.termcolours".setstyle;
 
 if os.getenv("__FLUSH_LOG") then
@@ -69,7 +67,7 @@ function apply_sink_rules(sink_type)
                for _, level in ipairs(logging_levels) do
                        if type(logging_config[level]) == "string" then
                                local value = logging_config[level];
-                               if sink_type == "file" then
+                               if sink_type == "file" and not value:match("^%*") then
                                        add_rule({
                                                to = sink_type;
                                                filename = value;
@@ -148,7 +146,7 @@ function reload_logging()
        
        logger.reset();
 
-       local debug_mode = config.get("*", "core", "debug");
+       local debug_mode = config.get("*", "debug");
 
        default_logging = { { to = "console" , levels = { min = (debug_mode and "debug") or "info" } } };
        default_file_logging = {
@@ -156,7 +154,7 @@ function reload_logging()
        };
        default_timestamp = "%b %d %H:%M:%S";
 
-       logging_config = config.get("*", "core", "log") or default_logging;
+       logging_config = config.get("*", "log") or default_logging;
        
        
        for name, sink_maker in pairs(old_sink_types) do