Rusty Russell
4a233090ae
log: rename struct log_record to struct log_book.
I think "log entry" when I see "log record", so this name is better.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
350d8edb7e
log: don't include dstate any more.
Before we had a global secp256k1_ctx we needed to hold this to print
out pubkeys, now it's completely orthogonal.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
f8eb454139
type_to_string: move pretty printing of types from log
It's not just useful for logging.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Lucas Betschart
900ab78d46
Fix -Wtautological-constant-out-of-range-compare
8 years ago
Rusty Russell
8015ceadfd
log: add netaddr
Also avoids allocating netaddr_name which otherwise lasts as long
as connection does.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
1518f4424e
log: add channel_state logging ability.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
bb0bf2b5ad
log: add easy way to log hex blobs.
Use it in one case, and also fix another logging FIXME.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
d0285416fb
log: ability to log struct rval.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
a35055c699
log: keep dstate pointer.
We need its secpctx pointer.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
45cac95331
log: logging for HTLCs.
The most complex thing we've logged yet, so we extract the core of the
log_struct_ function to call it multiple times.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
db72f33988
log: simplify union.
A well-placed cast avoids requirement for const and non-const members.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
5296b7f9a0
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>
9 years ago
Rusty Russell
29c8611e53
daemon: add helper to log hex.
Good for keys; eventually we'll want to log structures by type though.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
7b766f4bc8
daemon: fatal() function.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
89f1f1548e
daemon: dump logs on crash.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
117cf6b02d
daemon: add logging options.
Particularly logging to file.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
dd35260ce8
daemon: first code.
Logging code based heavily on pettycoin's.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago