Changeset

12244:858d40d675ee

util.startup: Teach prosodyctl to be completely --silent
author Kim Alvefur <zash@zash.se>
date Sun, 28 Nov 2021 23:07:51 +0100
parents 12243:73ecfe811526
children 12245:dfa3cac981bc
files man/prosodyctl.man man/prosodyctl.markdown util/startup.lua
diffstat 3 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/man/prosodyctl.man	Sun Nov 28 23:07:35 2021 +0100
+++ b/man/prosodyctl.man	Sun Nov 28 23:07:51 2021 +0100
@@ -141,6 +141,9 @@
 .TP
 \f[B]\f[CB]--quiet\f[B]\f[R]
 Reduce log level to only show errors.
+.TP
+\f[B]\f[CB]--silent\f[B]\f[R]
+Disable logging completely, leaving only command output.
 .SH FILES
 .TP
 \f[B]\f[CB]/etc/prosody/prosody.cfg.lua\f[B]\f[R]
--- a/man/prosodyctl.markdown	Sun Nov 28 23:07:35 2021 +0100
+++ b/man/prosodyctl.markdown	Sun Nov 28 23:07:51 2021 +0100
@@ -143,6 +143,9 @@
 `--quiet`
 :   Reduce log level to only show errors.
 
+`--silent`
+:   Disable logging completely, leaving only command output.
+
 # FILES
 
 `/etc/prosody/prosody.cfg.lua`
--- a/util/startup.lua	Sun Nov 28 23:07:35 2021 +0100
+++ b/util/startup.lua	Sun Nov 28 23:07:51 2021 +0100
@@ -475,6 +475,9 @@
 			log_level = "debug";
 		elseif prosody.opts.quiet then
 			log_level = "error";
+		elseif prosody.opts.silent then
+			config.set("*", "log", {}); -- ssssshush!
+			return
 		end
 	end
 	config.set("*", "log", { { levels = { min = log_level or "info" }, to = "console" } });