lightningd: have logging include an optional node_id for each entry.

A log can have a default node_id, which can be overridden on a per-entry
basis.  This changes the format of logging, so some tests need rework.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-11-17 22:11:33 +10:30
parent 4fa7b30836
commit e433d4ddc1
23 changed files with 176 additions and 85 deletions

View File

@@ -621,7 +621,6 @@ new_uncommitted_channel(struct peer *peer)
{
struct lightningd *ld = peer->ld;
struct uncommitted_channel *uc = tal(ld, struct uncommitted_channel);
const char *idname;
uc->peer = peer;
assert(!peer->uncommitted_channel);
@@ -629,10 +628,8 @@ new_uncommitted_channel(struct peer *peer)
uc->transient_billboard = NULL;
uc->dbid = wallet_get_channel_dbid(ld->wallet);
idname = type_to_string(uc, struct node_id, &uc->peer->id);
uc->log = new_log(uc, uc->peer->log_book, "%s chan #%"PRIu64":",
idname, uc->dbid);
tal_free(idname);
uc->log = new_log(uc, uc->peer->log_book, &uc->peer->id,
"chan #%"PRIu64":", uc->dbid);
uc->fc = NULL;
uc->our_config.id = 0;