| 595 | } |
| 596 | |
| 597 | static void maybe_print(struct logger *log, |
| 598 | const struct log_hdr *l, |
| 599 | const char *logmsg, |
| 600 | const u8 *iomsg) |
| 601 | { |
| 602 | if (l->level >= log->print_level) |
| 603 | log_to_files(log->log_book->prefix, log->prefix->prefix, l->level, |
| 604 | l->nc ? &l->nc->node_id : NULL, |
| 605 | log->need_refiltering ? &log->log_book->print_filters : NULL, |
| 606 | &l->time, logmsg, strlen(logmsg), |
| 607 | iomsg, l->iolen, |
| 608 | log->log_book->print_timestamps, |
| 609 | log->log_book->default_print_level, |
| 610 | log->log_book->log_files); |
| 611 | } |
| 612 | |
| 613 | static void maybe_notify_log(struct logger *log, |
| 614 | const struct log_hdr *l, |