10 local getstyle, getstring = require "util.termcolours".getstyle, require "util.termcolours".getstring; |
10 local getstyle, getstring = require "util.termcolours".getstyle, require "util.termcolours".getstring; |
11 |
11 |
12 local config = require "core.configmanager"; |
12 local config = require "core.configmanager"; |
13 local eventmanager = require "core.eventmanager"; |
13 local eventmanager = require "core.eventmanager"; |
14 local logger = require "util.logger"; |
14 local logger = require "util.logger"; |
|
15 local debug_mode = config.get("*", "core", "debug"); |
15 |
16 |
16 _G.log = logger.init("general"); |
17 _G.log = logger.init("general"); |
17 |
18 |
18 module "loggingmanager" |
19 module "loggingmanager" |
19 |
20 |
20 -- The log config used if none specified in the config file |
21 -- The log config used if none specified in the config file |
21 local default_logging = { { to = "console" } }; |
22 local default_logging = { { to = "console" } }; |
22 local default_file_logging = { { to = "file", levels = { min = "info" } } }; |
23 local default_file_logging = { { to = "file", levels = { min = (debug_mode and "debug") or "info" } } }; |
23 local default_timestamp = "%b %d %T"; |
24 local default_timestamp = "%b %d %T"; |
24 -- The actual config loggingmanager is using |
25 -- The actual config loggingmanager is using |
25 local logging_config = config.get("*", "core", "log") or default_logging; |
26 local logging_config = config.get("*", "core", "log") or default_logging; |
26 |
27 |
27 local apply_sink_rules; |
28 local apply_sink_rules; |