From: William Lallemand Date: Wed, 21 Nov 2018 17:04:52 +0000 (+0100) Subject: MINOR: log: introduce ha_notice() X-Git-Tag: v1.9-dev8~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9c56a22b20f7a609f0c00f9de3beb254cd02dd68;p=thirdparty%2Fhaproxy.git MINOR: log: introduce ha_notice() It's like ha_warning() or ha_alert() but with a NOTICE prefix. --- diff --git a/include/proto/log.h b/include/proto/log.h index 577e570ee2..e127431656 100644 --- a/include/proto/log.h +++ b/include/proto/log.h @@ -110,6 +110,12 @@ void ha_alert(const char *fmt, ...) void ha_warning(const char *fmt, ...) __attribute__ ((format(printf, 1, 2))); +/* + * Displays the message on stderr with the date and pid. + */ +void ha_notice(const char *fmt, ...) + __attribute__ ((format(printf, 1, 2))); + /* * Displays the message on only if quiet mode is not set. */ diff --git a/src/log.c b/src/log.c index 87019b08ab..3db3c0d9e4 100644 --- a/src/log.c +++ b/src/log.c @@ -921,6 +921,20 @@ void ha_warning(const char *fmt, ...) } } +/* + * Displays the message on stderr with the date and pid. + */ +void ha_notice(const char *fmt, ...) +{ + va_list argp; + + if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)) { + va_start(argp, fmt); + print_message("NOTICE", fmt, argp); + va_end(argp); + } +} + /* * Displays the message on only if quiet mode is not set. */