MCPcopy Create free account
hub / github.com/ElementsProject/lightning / lowest_filter

Function lowest_filter

lightningd/log.c:343–372  ·  view source on GitHub ↗

What's the lowest filtering which could possibly apply? */

Source from the content-addressed store, hash-verified

341
342/* What's the lowest filtering which could possibly apply? */
343static void lowest_filter(const struct list_head *print_filters,
344 const char *prefix,
345 const struct node_id *node_id,
346 enum log_level *level)
347{
348 struct print_filter *i;
349 const char *node_id_str;
350
351 if (node_id)
352 node_id_str = fmt_node_id(tmpctx, node_id);
353 else
354 node_id_str = NULL;
355
356 list_for_each(print_filters, i, list) {
357 bool match;
358
359 if (strstr(prefix, i->prefix))
360 match = true;
361 else if (node_id_str) {
362 match = (strstr(node_id_str, i->prefix) != NULL);
363 } else {
364 /* Could this possibly match a node_id? */
365 match = strstarts(i->prefix, "02") || strstarts(i->prefix, "03");
366 }
367
368 if (match && i->level < *level) {
369 *level = i->level;
370 }
371 }
372}
373
374static void log_to_files(const char *log_prefix,
375 const char *entry_prefix,

Callers 1

print_levelFunction · 0.85

Calls 1

fmt_node_idFunction · 0.85

Tested by

no test coverage detected