Software /
code /
prosody
Comparison
util/startup.lua @ 9877:ded5303e1fde
util.startup: Log configuration warnings at startup
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 20 Mar 2019 12:45:58 +0000 |
parent | 9873:dfaeea570f7e |
child | 9878:dd61201fc5af |
comparison
equal
deleted
inserted
replaced
9876:d812031c8716 | 9877:ded5303e1fde |
---|---|
5 local prosody = { events = require "util.events".new() }; | 5 local prosody = { events = require "util.events".new() }; |
6 local logger = require "util.logger"; | 6 local logger = require "util.logger"; |
7 local log = logger.init("startup"); | 7 local log = logger.init("startup"); |
8 | 8 |
9 local config = require "core.configmanager"; | 9 local config = require "core.configmanager"; |
10 local config_warnings; | |
10 | 11 |
11 local dependencies = require "util.dependencies"; | 12 local dependencies = require "util.dependencies"; |
12 | 13 |
13 local original_logging_config; | 14 local original_logging_config; |
14 | 15 |
62 print("More help on configuring Prosody can be found at https://prosody.im/doc/configure"); | 63 print("More help on configuring Prosody can be found at https://prosody.im/doc/configure"); |
63 print("Good luck!"); | 64 print("Good luck!"); |
64 print("**************************"); | 65 print("**************************"); |
65 print(""); | 66 print(""); |
66 os.exit(1); | 67 os.exit(1); |
68 elseif err and #err > 0 then | |
69 config_warnings = err; | |
67 end | 70 end |
68 prosody.config_loaded = true; | 71 prosody.config_loaded = true; |
69 end | 72 end |
70 | 73 |
71 function startup.check_dependencies() | 74 function startup.check_dependencies() |
96 end); | 99 end); |
97 end | 100 end |
98 | 101 |
99 function startup.log_startup_warnings() | 102 function startup.log_startup_warnings() |
100 dependencies.log_warnings(); | 103 dependencies.log_warnings(); |
104 for _, warning in ipairs(config_warnings) do | |
105 log("warn", "Configuration warning: %s", warning); | |
106 end | |
101 end | 107 end |
102 | 108 |
103 function startup.sanity_check() | 109 function startup.sanity_check() |
104 for host, host_config in pairs(config.getconfig()) do | 110 for host, host_config in pairs(config.getconfig()) do |
105 if host ~= "*" | 111 if host ~= "*" |