Comparison

core/loggingmanager.lua @ 4123:0c9399a66b17

loggingmanager: Re-read 'debug' option on reload.
author Waqas Hussain <waqas20@gmail.com>
date Thu, 13 Jan 2011 02:31:10 +0500
parent 4117:b42ca82b0ea4
child 4124:3761aa844d65
comparison
equal deleted inserted replaced
4117:b42ca82b0ea4 4123:0c9399a66b17
24 end 24 end
25 25
26 local config = require "core.configmanager"; 26 local config = require "core.configmanager";
27 local logger = require "util.logger"; 27 local logger = require "util.logger";
28 local prosody = prosody; 28 local prosody = prosody;
29
30 local debug_mode = config.get("*", "core", "debug");
31 29
32 _G.log = logger.init("general"); 30 _G.log = logger.init("general");
33 31
34 module "loggingmanager" 32 module "loggingmanager"
35 33
164 log_sink_types[name] = nil; 162 log_sink_types[name] = nil;
165 end 163 end
166 164
167 logger.reset(); 165 logger.reset();
168 166
167 local debug_mode = config.get("*", "core", "debug");
168
169 default_logging = { { to = "console" , levels = { min = (debug_mode and "debug") or "info" } } }; 169 default_logging = { { to = "console" , levels = { min = (debug_mode and "debug") or "info" } } };
170 default_file_logging = { 170 default_file_logging = {
171 { to = "file", levels = { min = (debug_mode and "debug") or "info" }, timestamps = true } 171 { to = "file", levels = { min = (debug_mode and "debug") or "info" }, timestamps = true }
172 }; 172 };
173 default_timestamp = "%b %d %H:%M:%S"; 173 default_timestamp = "%b %d %H:%M:%S";