Skip to main content

log_set

family

Declared in clika_rt/clika_rt_core.h.

Members​

NameDescription
log_set_callbackdeliver every record the runtime logs to fn(userdata, level, line, len): line is the formatted record WITHOUT a trailing newline and WITHOUT a NUL terminator (len bytes), valid for the call only; the runtime's own console output continues beside it. fn is the contract §7 triple: it fires on whichever thread logged, must be cheap, and must not log back; ONE sink is ever installed, so a second call REPLACES the target and runs the previous fn_userdata_free exactly once (after any in-flight call of the previous target returns); a NULL fn clears the sink (its own fn_userdata_free, if any, runs at once)
log_set_levelthe runtime's logging threshold: records below level are dropped (CLIKA_RT_LOG_LEVEL_OFF silences the channel)

Functions​

log_set_callback​

clika_rt_error*(* log_set_callback)(void(*fn)(void *userdata, clika_rt_log_level level, const char *line, size_t len), void *fn_userdata, void(*fn_userdata_free)(void *))

deliver every record the runtime logs to fn(userdata, level, line, len): line is the formatted record WITHOUT a trailing newline and WITHOUT a NUL terminator (len bytes), valid for the call only; the runtime's own console output continues beside it. fn is the contract §7 triple: it fires on whichever thread logged, must be cheap, and must not log back; ONE sink is ever installed, so a second call REPLACES the target and runs the previous fn_userdata_free exactly once (after any in-flight call of the previous target returns); a NULL fn clears the sink (its own fn_userdata_free, if any, runs at once)

Declared in clika_rt/clika_rt_core.h, line 665

log_set_level​

clika_rt_error*(* log_set_level)(clika_rt_log_level level)

the runtime's logging threshold: records below level are dropped (CLIKA_RT_LOG_LEVEL_OFF silences the channel)

Declared in clika_rt/clika_rt_core.h, line 654