From 6abd0110a473a0f96bb8d7df433cdb1a966f8a4d Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Thu, 13 Jan 2011 02:31:10 +0500 Subject: loggingmanager: Re-read 'debug' option on reload. --- core/loggingmanager.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/loggingmanager.lua b/core/loggingmanager.lua index 0e0ae862..460afeaf 100644 --- a/core/loggingmanager.lua +++ b/core/loggingmanager.lua @@ -27,8 +27,6 @@ local config = require "core.configmanager"; local logger = require "util.logger"; local prosody = prosody; -local debug_mode = config.get("*", "core", "debug"); - _G.log = logger.init("general"); module "loggingmanager" @@ -166,6 +164,8 @@ function reload_logging() logger.reset(); + local debug_mode = config.get("*", "core", "debug"); + default_logging = { { to = "console" , levels = { min = (debug_mode and "debug") or "info" } } }; default_file_logging = { { to = "file", levels = { min = (debug_mode and "debug") or "info" }, timestamps = true } -- cgit v1.2.3 From db0a3bec91111b02b2b4435c6a011c55aa2f4b8c Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Thu, 13 Jan 2011 02:33:50 +0500 Subject: loggingmanager: Fix reading configuration of timestamps for console output. --- core/loggingmanager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/loggingmanager.lua b/core/loggingmanager.lua index 460afeaf..b637058c 100644 --- a/core/loggingmanager.lua +++ b/core/loggingmanager.lua @@ -195,7 +195,7 @@ end -- Column width for "source" (used by stdout and console) local sourcewidth = 20; -function log_sink_types.stdout() +function log_sink_types.stdout(config) local timestamps = config.timestamps; if timestamps == true then -- cgit v1.2.3 From 75862530f265ec9fdc58f7937d90367d252ce74a Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 21 Jan 2011 14:02:02 +0000 Subject: net.dns: Fix tostring() for SRV records --- net/dns.lua | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/net/dns.lua b/net/dns.lua index 61fb62e8..c905f56c 100644 --- a/net/dns.lua +++ b/net/dns.lua @@ -158,8 +158,6 @@ resolver.__index = resolver; resolver.timeout = default_timeout; -local SRV_tostring; - local function default_rr_tostring(rr) local rr_val = rr.type and rr[rr.type:lower()]; if type(rr_val) ~= "string" then @@ -170,8 +168,13 @@ end local special_tostrings = { LOC = resolver.LOC_tostring; - MX = function (rr) return string.format('%2i %s', rr.pref, rr.mx); end; - SRV = SRV_tostring; + MX = function (rr) + return string.format('%2i %s', rr.pref, rr.mx); + end; + SRV = function (rr) + local s = rr.srv; + return string.format('%5d %5d %5d %s', s.priority, s.weight, s.port, s.target); + end; }; local rr_metatable = {}; -- - - - - - - - - - - - - - - - - - - rr_metatable @@ -475,12 +478,6 @@ function resolver:PTR(rr) rr.ptr = self:name(); end -function SRV_tostring(rr) -- - - - - - - - - - - - - - - - - - SRV_tostring - local s = rr.srv; - return string.format( '%5d %5d %5d %s', s.priority, s.weight, s.port, s.target ); -end - - function resolver:TXT(rr) -- - - - - - - - - - - - - - - - - - - - - - TXT rr.txt = self:sub (rr.rdlength); end -- cgit v1.2.3