Comparison

core/loggingmanager.lua @ 2925:692b3c6c5bd2

Merge 0.6->0.7
author Matthew Wild <mwild1@gmail.com>
date Mon, 22 Mar 2010 17:24:55 +0000
parent 2586:26ead5e16cd3
parent 2923:b7049746bd29
child 2963:abd1a30330e0
child 3017:31cda82337dc
child 3043:1fadbb2e3ca0
comparison
equal deleted inserted replaced
2918:79ca9f686aaf 2925:692b3c6c5bd2
1 -- Prosody IM 1 -- Prosody IM
2 -- Copyright (C) 2008-2009 Matthew Wild 2 -- Copyright (C) 2008-2010 Matthew Wild
3 -- Copyright (C) 2008-2009 Waqas Hussain 3 -- Copyright (C) 2008-2010 Waqas Hussain
4 -- 4 --
5 -- This project is MIT/X11 licensed. Please see the 5 -- This project is MIT/X11 licensed. Please see the
6 -- COPYING file in the source package for more information. 6 -- COPYING file in the source package for more information.
7 -- 7 --
8 8
33 module "loggingmanager" 33 module "loggingmanager"
34 34
35 -- The log config used if none specified in the config file 35 -- The log config used if none specified in the config file
36 local default_logging = { { to = "console" } }; 36 local default_logging = { { to = "console" } };
37 local default_file_logging = { { to = "file", levels = { min = (debug_mode and "debug") or "info" }, timestamps = true } }; 37 local default_file_logging = { { to = "file", levels = { min = (debug_mode and "debug") or "info" }, timestamps = true } };
38 local default_timestamp = "%b %d %T"; 38 local default_timestamp = "%b %d %H:%M:%S";
39 -- The actual config loggingmanager is using 39 -- The actual config loggingmanager is using
40 local logging_config = config.get("*", "core", "log") or default_logging; 40 local logging_config = config.get("*", "core", "log") or default_logging;
41 41
42 local apply_sink_rules; 42 local apply_sink_rules;
43 local log_sink_types = setmetatable({}, { __newindex = function (t, k, v) rawset(t, k, v); apply_sink_rules(k); end; }); 43 local log_sink_types = setmetatable({}, { __newindex = function (t, k, v) rawset(t, k, v); apply_sink_rules(k); end; });