For serious situations that require attention and in which messages should always be logged, use slapi_log_warning_ex().
In the following example, foobar() logs a warning because the disk is nearly full.
#include "slapi-plugin.h"
#include "example-com-warning-ids.h" /* example.com unique
warning IDs file */
int
foobar()
{
int disk_use_percentage;
/* ... */
if (disk_use_percentage >= 95) {
slapi_log_warning_ex(
EXCOM_DISK_FULL_WARN, /* unique warning ID */
SLAPI_LOG_NO_MSGID,
SLAPI_LOG_NO_CONNID,
SLAPI_LOG_NO_OPID,
"example.com: foobar in baz plug-in",
"disk %.0f%% full, find more space\n",
disk_use_percentage
);
}
return 0;
}