]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: log: do not discard stderr when starting is over
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 26 May 2021 09:05:45 +0000 (11:05 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 7 Jun 2021 14:58:16 +0000 (16:58 +0200)
Always print message in ha_alert/warning/notice when starting is over,
regardless of quiet/verbose options.

This change is useful to retrieve the output via the newly implemented
user messages buffer at runtime, for the CLI handlers.

src/errors.c

index b2ff42970717a224ed51708810f2b62c954687ca..9da04f91846b0c753cce2f7867372c33bbf1dbf1 100644 (file)
@@ -129,8 +129,9 @@ void ha_alert(const char *fmt, ...)
 {
        va_list argp;
 
-       if (!(global.mode & MODE_QUIET) || (global.mode & (MODE_VERBOSE | MODE_STARTING))) {
-               if (!(warned & WARN_EXEC_PATH)) {
+       if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE) ||
+           !(global.mode & MODE_STARTING)) {
+               if (!(warned & WARN_EXEC_PATH) && (global.mode & MODE_STARTING)) {
                        const char *path = get_exec_path();
 
                        warned |= WARN_EXEC_PATH;
@@ -153,7 +154,8 @@ void ha_warning(const char *fmt, ...)
 
        warned |= WARN_ANY;
 
-       if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)) {
+       if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE) ||
+           !(global.mode & MODE_STARTING)) {
                va_start(argp, fmt);
                print_message("WARNING", fmt, argp);
                va_end(argp);
@@ -203,7 +205,8 @@ void ha_notice(const char *fmt, ...)
 {
        va_list argp;
 
-       if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)) {
+       if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE) ||
+           !(global.mode & MODE_STARTING)) {
                va_start(argp, fmt);
                print_message("NOTICE", fmt, argp);
                va_end(argp);