| 485 | } |
| 486 | |
| 487 | static struct io_plan *log_msg_in(struct io_conn *conn, |
| 488 | struct router_child *child) |
| 489 | { |
| 490 | enum log_level level; |
| 491 | char *entry; |
| 492 | struct node_id *peer; |
| 493 | |
| 494 | if (fromwire_status_log(tmpctx, child->log_msg, &level, &peer, &entry)) |
| 495 | cmd_log(tmpctx, child->cmd, level, "%s", entry); |
| 496 | else { |
| 497 | cmd_log(tmpctx, child->cmd, LOG_BROKEN, |
| 498 | "unexpected non-log message %s", |
| 499 | tal_hex(tmpctx, child->log_msg)); |
| 500 | } |
| 501 | return io_read_wire(conn, child, &child->log_msg, log_msg_in, child); |
| 502 | } |
| 503 | |
| 504 | static struct io_plan *child_log_init(struct io_conn *conn, |
| 505 | struct router_child *child) |