C Collections

clogger · Section 3

clog_trace

clog_trace - emit a log line at TRACE level

C Collections (libccollections, -lccollections)

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

Writes a log line at CLOG_TRACE level and picks up __FILE__, __LINE__
and __func__ for you.  It appends no backtrace.
 
The output format is:
  ts=<ISO-8601-UTC> level=TRACE proc=<name>(<pid>):<tname>(<tid>) src=<file>:<line> func=<fn> [fields] msg=<text>
 
When the minimum level of the logger is above CLOG_TRACE, the call does
nothing.

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

TRACE is the finest level and produces a lot of output, so turn it on
only when you diagnose low-level behaviour.
Every clog_<level> macro has the same thread-safety guarantee: The
shared write lock covers the whole cycle that formats and writes a
record, so a partial line never ends up between the lines of another
thread.

clog_trace(lg, "entered function, x=%d", x);

clog_debug(3), clog_info(3), clog_warn(3), clog_error(3), clog_alert(3), clog_fatal(3), clog_create_from_fd_mp(3), clog_set_level(3)