common: allow subdaemons to specify the node_id in status messages.

This is ignored in subdaemons which are per-peer, but very useful for
multi-peer daemons like connectd and gossipd.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-11-17 22:12:33 +10:30
parent e433d4ddc1
commit 00cb5adfe6
28 changed files with 140 additions and 60 deletions

View File

@@ -49,11 +49,15 @@ static bool initial_sync = false;
static unsigned long max_messages = -1UL;
/* Empty stubs to make us compile */
void status_peer_io(enum log_level iodir, const u8 *p)
void status_peer_io(enum log_level iodir,
const struct node_id *node_id,
const u8 *p)
{
}
void status_fmt(enum log_level level, const char *fmt, ...)
void status_fmt(enum log_level level,
const struct node_id *node_id,
const char *fmt, ...)
{
}

View File

@@ -23,7 +23,9 @@
static bool verbose = false;
void status_fmt(enum log_level level, const char *fmt, ...)
void status_fmt(enum log_level level,
const struct node_id *node_id,
const char *fmt, ...)
{
if (verbose) {
va_list ap;

View File

@@ -28,7 +28,9 @@
static bool verbose = false;
void status_fmt(enum log_level level, const char *fmt, ...)
void status_fmt(enum log_level level,
const struct node_id *node_id,
const char *fmt, ...)
{
if (verbose) {
va_list ap;

View File

@@ -21,7 +21,9 @@
#include <common/utxo.h>
#include <stdio.h>
void status_fmt(enum log_level level, const char *fmt, ...)
void status_fmt(enum log_level level,
const struct node_id *node_id,
const char *fmt, ...)
{
}