Changeset

9877:ded5303e1fde

util.startup: Log configuration warnings at startup
author Matthew Wild <mwild1@gmail.com>
date Wed, 20 Mar 2019 12:45:58 +0000
parents 9876:d812031c8716
children 9878:dd61201fc5af
files util/startup.lua
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/startup.lua	Wed Mar 20 12:45:08 2019 +0000
+++ b/util/startup.lua	Wed Mar 20 12:45:58 2019 +0000
@@ -7,6 +7,7 @@
 local log = logger.init("startup");
 
 local config = require "core.configmanager";
+local config_warnings;
 
 local dependencies = require "util.dependencies";
 
@@ -64,6 +65,8 @@
 		print("**************************");
 		print("");
 		os.exit(1);
+	elseif err and #err > 0 then
+		config_warnings = err;
 	end
 	prosody.config_loaded = true;
 end
@@ -98,6 +101,9 @@
 
 function startup.log_startup_warnings()
 	dependencies.log_warnings();
+	for _, warning in ipairs(config_warnings) do
+		log("warn", "Configuration warning: %s", warning);
+	end
 end
 
 function startup.sanity_check()