C Collections

clogger · Section 3

clog_warn

clog_warn - emit a log line at WARN level

C Collections (libccollections, -lccollections)

#include <ccollections/clogger.h>
 
clog_warn(clog lg, const char *fmt, ...);

Writes a log line at CLOG_WARN level and picks up __FILE__, __LINE__
and __func__ for you.  It appends no backtrace.
 
WARN is meant for a condition that the program recovers from, something
that doesn't stop normal operation but that someone should look at.

lg     Logger handle (clog).
fmt    printf-style format string.
...    Format arguments (optional).

clog_warn(lg, "retry %d/%d connecting to %s", attempt, max, host);
clog_warn(lg, "config key %s missing, using default", key);

clog_info(3), clog_error(3), clog_alert(3), clog_fatal(3)