diff --git a/include/haproxy/errors.h b/include/haproxy/errors.h index c102fedb8..1fa501724 100644 --- a/include/haproxy/errors.h +++ b/include/haproxy/errors.h @@ -101,6 +101,8 @@ void ha_warning(const char *fmt, ...) * These functions are reserved to output diagnostics on MODE_DIAG. * Use the underscore variants only if MODE_DIAG has already been checked. */ +void ha_diag_notice(const char *fmt, ...) + __attribute__ ((format(printf, 1 ,2))); void _ha_vdiag_warning(const char *fmt, va_list argp); void _ha_diag_warning(const char *fmt, ...); void ha_diag_warning(const char *fmt, ...) diff --git a/src/errors.c b/src/errors.c index f71622c0a..9f334dbe4 100644 --- a/src/errors.c +++ b/src/errors.c @@ -386,6 +386,20 @@ void ha_diag_warning(const char *fmt, ...) } } +/* + * Displays the message on stderr with the pid if MODE_DIAG is set. + */ +void ha_diag_notice(const char *fmt, ...) +{ + va_list argp; + + if (global.mode & MODE_DIAG) { + va_start(argp, fmt); + print_message(1, "DIAG", fmt, argp); + va_end(argp); + } +} + /* * Displays the message on stderr with the pid. */