From: Amaury Denoyelle Date: Fri, 28 May 2021 07:57:10 +0000 (+0200) Subject: MINOR: log: display exec path on first warning X-Git-Tag: v2.5-dev1~194 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=da3d68111c21f1f2e088b5db2ed4f72737680d3b;p=thirdparty%2Fhaproxy.git MINOR: log: display exec path on first warning Display process executable path on first warning if not already done in ha_warning, as in ha_alert. The output is thus cleaner when ALERT and WARN messages are mixed, with the executable path always on first position. --- diff --git a/src/errors.c b/src/errors.c index 81c893445d..88534ae384 100644 --- a/src/errors.c +++ b/src/errors.c @@ -240,6 +240,14 @@ void ha_warning(const char *fmt, ...) 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; + print_message_args(0, "NOTICE", "haproxy version is %s\n", haproxy_version); + if (path) + print_message_args(0, "NOTICE", "path to executable is %s\n", path); + } va_start(argp, fmt); print_message(1, "WARNING", fmt, argp); va_end(argp);