util/startup.lua
changeset 12247 73ecfe811526
parent 12164 ac654fb19203
child 12248 858d40d675ee
equal deleted inserted replaced
12246:202319a990e7 12247:73ecfe811526
   468 
   468 
   469 -- Override logging config (used by prosodyctl)
   469 -- Override logging config (used by prosodyctl)
   470 function startup.force_console_logging()
   470 function startup.force_console_logging()
   471 	original_logging_config = config.get("*", "log");
   471 	original_logging_config = config.get("*", "log");
   472 	local log_level = os.getenv("PROSODYCTL_LOG_LEVEL");
   472 	local log_level = os.getenv("PROSODYCTL_LOG_LEVEL");
   473 	if not log_level and prosody.opts.verbose then log_level = "debug"; end
   473 	if not log_level then
       
   474 		if prosody.opts.verbose then
       
   475 			log_level = "debug";
       
   476 		elseif prosody.opts.quiet then
       
   477 			log_level = "error";
       
   478 		end
       
   479 	end
   474 	config.set("*", "log", { { levels = { min = log_level or "info" }, to = "console" } });
   480 	config.set("*", "log", { { levels = { min = log_level or "info" }, to = "console" } });
   475 end
   481 end
   476 
   482 
   477 function startup.switch_user()
   483 function startup.switch_user()
   478 	-- Switch away from root and into the prosody user --
   484 	-- Switch away from root and into the prosody user --