]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Remove the log switching cacophony on startup
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Mon, 4 Dec 2023 20:56:54 +0000 (17:56 -0300)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Mon, 4 Dec 2023 21:43:52 +0000 (18:43 -0300)
Resolves the first complaint of #103:

> I believe that if syslog output is enabled on the command line then
> fort should be able to not report these useless messages about
> switching the output back and forward.
>
> Also, there is no point in reporting in syslog that messages are
> being sent to syslog and on the console that messages are being sent
> to the console because this is self-evident.

Looking back at the history, it seems these messages were born because
a long time ago, sys-logging was hardcoded to "server" mode, while
console "logging" was tied to "standalone" mode. Default was "server,"
which meant a newcomer who managed to kickstart Fort in the foreground
with minimal arguments ended up with a validator that, on account of
looking silent, seemed to be doing absolutely nothing.

Given than logmode and runmode are completely independent now, and log
output defaults to "console," it would appear that these messages are,
as a matter of fact, completely useless.

src/log.c

index b56facd9842270f8e957b65c92395cf6a5d1872c..9813f4686480dcdd3379d1261bcddf87f09d7b1f 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -264,19 +264,13 @@ log_start(void)
        if (config_get_val_log_enabled()) {
                switch (config_get_val_log_output()) {
                case SYSLOG:
-                       pr_op_info("Syslog log output configured; disabling validation logging on standard streams.");
-                       pr_op_info("(Validation Logs will be sent to syslog only.)");
                        val_config.fprintf_enabled = false;
                        break;
                case CONSOLE:
-                       pr_op_info("Console log output configured; disabling validation logging on syslog.");
-                       pr_op_info("(Validation Logs will be sent to the standard streams only.)");
                        val_config.syslog_enabled = false;
                        break;
                }
        } else {
-               pr_op_info("Disabling validation logging on syslog.");
-               pr_op_info("Disabling validation logging on standard streams.");
                val_config.fprintf_enabled = false;
                val_config.syslog_enabled = false;
        }
@@ -284,13 +278,9 @@ log_start(void)
        if (config_get_op_log_enabled()) {
                switch (config_get_op_log_output()) {
                case SYSLOG:
-                       pr_op_info("Syslog log output configured; disabling operation logging on standard streams.");
-                       pr_op_info("(Operation Logs will be sent to syslog only.)");
                        op_config.fprintf_enabled = false;
                        break;
                case CONSOLE:
-                       pr_op_info("Console log output configured; disabling operation logging on syslog.");
-                       pr_op_info("(Operation Logs will be sent to the standard streams only.)");
                        if (val_config.syslog_enabled)
                                op_config.syslog_enabled = false;
                        else
@@ -298,8 +288,6 @@ log_start(void)
                        break;
                }
        } else {
-               pr_op_info("Disabling operation logging on syslog.");
-               pr_op_info("Disabling operation logging on standard streams.");
                op_config.fprintf_enabled = false;
                if (val_config.syslog_enabled)
                        op_config.syslog_enabled = false;