MINOR: log: introduce ha_notice()

It's like ha_warning() or ha_alert() but with a NOTICE prefix.
This commit is contained in:
William Lallemand 2018-11-21 18:04:52 +01:00 committed by Willy Tarreau
parent 944e619b64
commit 9c56a22b20
2 changed files with 20 additions and 0 deletions

View File

@ -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 <out> only if quiet mode is not set.
*/

View File

@ -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 <out> only if quiet mode is not set.
*/