| 535 | } |
| 536 | |
| 537 | static struct io_plan *log_msg_in(struct io_conn *conn, |
| 538 | struct router_child *child) |
| 539 | { |
| 540 | enum log_level level; |
| 541 | char *entry; |
| 542 | struct node_id *peer; |
| 543 | |
| 544 | if (fromwire_status_log(tmpctx, child->log_msg, &level, &peer, &entry)) |
| 545 | cmd_log(tmpctx, child->cmd, level, "%s", entry); |
| 546 | else { |
| 547 | cmd_log(tmpctx, child->cmd, LOG_BROKEN, |
| 548 | "unexpected non-log message %s", |
| 549 | tal_hex(tmpctx, child->log_msg)); |
| 550 | } |
| 551 | return io_read_wire(conn, child, &child->log_msg, log_msg_in, child); |
| 552 | } |
| 553 | |
| 554 | static struct io_plan *child_log_init(struct io_conn *conn, |
| 555 | struct router_child *child) |