transition from status_trace() to status_debug

This commit is contained in:
darosior
2019-09-08 18:39:26 +02:00
committed by Rusty Russell
parent 0504a51211
commit 0b0ad4c22d
27 changed files with 210 additions and 213 deletions

View File

@@ -103,19 +103,19 @@ u8 *sync_crypto_read(const tal_t *ctx, struct per_peer_state *pps)
u16 len;
if (!read_all(pps->peer_fd, hdr, sizeof(hdr))) {
status_trace("Failed reading header: %s", strerror(errno));
status_debug("Failed reading header: %s", strerror(errno));
peer_failed_connection_lost();
}
if (!cryptomsg_decrypt_header(&pps->cs, hdr, &len)) {
status_trace("Failed hdr decrypt with rn=%"PRIu64,
status_debug("Failed hdr decrypt with rn=%"PRIu64,
pps->cs.rn-1);
peer_failed_connection_lost();
}
enc = tal_arr(ctx, u8, len + 16);
if (!read_all(pps->peer_fd, enc, tal_count(enc))) {
status_trace("Failed reading body: %s", strerror(errno));
status_debug("Failed reading body: %s", strerror(errno));
peer_failed_connection_lost();
}

View File

@@ -63,7 +63,7 @@ static void maybe_rotate_key(u64 *n, struct secret *k, struct secret *ck)
*/
hkdf_two_keys(&new_ck, &new_k, ck, k);
#ifdef SUPERVERBOSE
status_trace("# 0x%s, 0x%s = HKDF(0x%s, 0x%s)",
status_debug("# 0x%s, 0x%s = HKDF(0x%s, 0x%s)",
tal_hexstr(trc, &new_ck, sizeof(new_ck)),
tal_hexstr(trc, &new_k, sizeof(new_k)),
tal_hexstr(trc, ck, sizeof(*ck)),
@@ -204,7 +204,7 @@ u8 *cryptomsg_encrypt_msg(const tal_t *ctx,
assert(ret == 0);
assert(clen == sizeof(l) + 16);
#ifdef SUPERVERBOSE
status_trace("# encrypt l: cleartext=0x%s, AD=NULL, sn=0x%s, sk=0x%s => 0x%s",
status_debug("# encrypt l: cleartext=0x%s, AD=NULL, sn=0x%s, sk=0x%s => 0x%s",
tal_hexstr(trc, &l, sizeof(l)),
tal_hexstr(trc, npub, sizeof(npub)),
tal_hexstr(trc, &cs->sk, sizeof(cs->sk)),
@@ -229,7 +229,7 @@ u8 *cryptomsg_encrypt_msg(const tal_t *ctx,
assert(ret == 0);
assert(clen == mlen + 16);
#ifdef SUPERVERBOSE
status_trace("# encrypt m: cleartext=0x%s, AD=NULL, sn=0x%s, sk=0x%s => 0x%s",
status_debug("# encrypt m: cleartext=0x%s, AD=NULL, sn=0x%s, sk=0x%s => 0x%s",
tal_hexstr(trc, msg, mlen),
tal_hexstr(trc, npub, sizeof(npub)),
tal_hexstr(trc, &cs->sk, sizeof(cs->sk)),

View File

@@ -80,7 +80,7 @@ enum dev_disconnect dev_disconnect(int pkt_type)
err(1, "lseek failure");
}
status_trace("dev_disconnect: %s%s", dev_disconnect_line,
status_debug("dev_disconnect: %s%s", dev_disconnect_line,
dev_disconnect_nocommit ? "-nocommit" : "");
if (dev_disconnect_nocommit)
dev_suppress_commit = true;

View File

@@ -82,7 +82,7 @@ const char *got_pong(const u8 *pong, size_t *num_pings_outstanding)
if (ignored[i] < ' ' || ignored[i] == 127)
break;
}
status_trace("Got pong %zu bytes (%.*s...)",
status_debug("Got pong %zu bytes (%.*s...)",
tal_count(ignored), i, (char *)ignored);
(*num_pings_outstanding)--;

View File

@@ -185,7 +185,7 @@ bool handle_peer_gossip_or_error(struct per_peer_state *pps,
/* They're talking about a different channel? */
if (is_wrong_channel(msg, channel_id, &actual)) {
status_trace("Rejecting %s for unknown channel_id %s",
status_debug("Rejecting %s for unknown channel_id %s",
wire_type_name(fromwire_peektype(msg)),
type_to_string(tmpctx, struct channel_id, &actual));
sync_crypto_write(pps,

View File

@@ -44,7 +44,7 @@ static void report_logging_io(const char *why)
{
if (logging_io != was_logging_io) {
was_logging_io = logging_io;
status_trace("%s: IO LOGGING %s",
status_debug("%s: IO LOGGING %s",
why, logging_io ? "ENABLED" : "DISABLED");
}
}

View File

@@ -40,9 +40,6 @@ void status_io(enum log_level iodir, const char *who,
#define status_broken( ...) \
status_fmt(LOG_BROKEN, __VA_ARGS__)
/* FIXME: Transition */
#define status_trace(...) status_debug(__VA_ARGS__)
/* Send a failure status code with printf-style msg, and exit. */
void status_failed(enum status_failreason code,
const char *fmt, ...) PRINTF_FMT(2,3) NORETURN;

View File

@@ -64,7 +64,7 @@ static int dump_syminfo(void *data UNUSED, uintptr_t pc UNUSED,
if (!filename || !function)
return 0;
status_trace(" %s:%u (%s)", filename, lineno, function);
status_debug(" %s:%u (%s)", filename, lineno, function);
return 0;
}
@@ -74,7 +74,7 @@ static void dump_leak_backtrace(const uintptr_t *bt)
return;
/* First one serves as counter. */
status_trace(" backtrace:");
status_debug(" backtrace:");
for (size_t i = 1; i < bt[0]; i++) {
backtrace_pcinfo(backtrace_state,
bt[i], dump_syminfo,