log: add structure logging.

Uses a gcc extension (cast to union) for typechecking, but that can be
removed for compilers which don't support it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-06-29 06:49:21 +09:30
parent 04b3e8f91d
commit 5296b7f9a0
4 changed files with 93 additions and 23 deletions

View File

@@ -209,6 +209,5 @@ void secrets_init(struct lightningd_state *dstate)
SECP256K1_EC_COMPRESSED))
fatal("Invalid privkey");
log_info(dstate->base_log, "ID: ");
log_add_hex(dstate->base_log, dstate->id.der, sizeof(dstate->id.der));
log_info_struct(dstate->base_log, "ID: %s", struct pubkey, &dstate->id);
}