# HG changeset patch # User Matthew Wild # Date 1295618576 0 # Node ID 5044698a9d90438271d5f272df9a16134dafd1a3 # Parent 2e4bc196fd2a4c510cd5f55a37d25b99202efaf2# Parent 5cf13260edec1a561637a616127a33141d80827c Merge 0.8->trunk diff -r 2e4bc196fd2a -r 5044698a9d90 core/loggingmanager.lua --- a/core/loggingmanager.lua Fri Jan 21 04:36:31 2011 +0500 +++ b/core/loggingmanager.lua Fri Jan 21 14:02:56 2011 +0000 @@ -27,8 +27,6 @@ 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 @@ 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 } @@ -195,7 +195,7 @@ -- 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 diff -r 2e4bc196fd2a -r 5044698a9d90 net/dns.lua --- a/net/dns.lua Fri Jan 21 04:36:31 2011 +0500 +++ b/net/dns.lua Fri Jan 21 14:02:56 2011 +0000 @@ -158,8 +158,6 @@ 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 @@ 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 @@ 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