MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / emit_line

Function emit_line

src/foundation/log.c:216–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216static void emit_line(const char *line) {
217 /* Load ONCE: re-reading the global between the test and the call would
218 * let a concurrent cbm_log_set_sink turn a checked pointer into a NULL
219 * call. */
220 cbm_log_sink_fn sink = atomic_load_explicit(&g_log_sink, memory_order_relaxed);
221 if (sink) {
222 sink(line);
223 if (atomic_load_explicit(&g_log_sink_mode, memory_order_relaxed) == CBM_LOG_SINK_REPLACE) {
224 return;
225 }
226 }
227 (void)fprintf(stderr, "%s\n", line);
228}
229
230void cbm_log(CBMLogLevel level, const char *msg, ...) {
231 if (level < atomic_load_explicit(&g_log_level, memory_order_relaxed)) {

Callers 2

cbm_logFunction · 0.85
cbm_log_control_recordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected