| 196 | } |
| 197 | |
| 198 | static void emit_line(const char *line) { |
| 199 | if (g_log_sink) { |
| 200 | g_log_sink(line); |
| 201 | if (g_log_sink_mode == CBM_LOG_SINK_REPLACE) { |
| 202 | return; |
| 203 | } |
| 204 | } |
| 205 | (void)fprintf(stderr, "%s\n", line); |
| 206 | } |
| 207 | |
| 208 | void cbm_log(CBMLogLevel level, const char *msg, ...) { |
| 209 | if (level < g_log_level) { |