From 318e49e9c79c7b2b1c42b295da9acb53af93d202 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 13 Oct 2024 09:53:45 +1030 Subject: [PATCH] askrene: more logging in explain_failure. Lagrang3 doesn't like the logging in here at all, but he suggested we at least be consistent! Signed-off-by: Rusty Russell --- plugins/askrene/explain_failure.c | 46 +++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/plugins/askrene/explain_failure.c b/plugins/askrene/explain_failure.c index d4cd7cb01..626be3fe9 100644 --- a/plugins/askrene/explain_failure.c +++ b/plugins/askrene/explain_failure.c @@ -133,33 +133,33 @@ static const char *check_capacity(const tal_t *ctx, node_stats(rq, node, node_direction, &stats); if (amount_msat_greater(amount, stats.total.capacity)) { - return tal_fmt(ctx, - NO_USABLE_PATHS_STRING - " Total %s capacity is only %s" - " (in %zu channels).", - name, - fmt_amount_msat(tmpctx, stats.total.capacity), - stats.total.num_channels); + return rq_log(ctx, rq, LOG_DBG, + NO_USABLE_PATHS_STRING + " Total %s capacity is only %s" + " (in %zu channels).", + name, + fmt_amount_msat(tmpctx, stats.total.capacity), + stats.total.num_channels); } if (amount_msat_greater(amount, stats.gossip_known.capacity)) { - return tal_fmt(ctx, - NO_USABLE_PATHS_STRING - " Missing gossip for %s: only known %zu/%zu channels, leaving capacity only %s of %s.", - name, - stats.gossip_known.num_channels, - stats.total.num_channels, - fmt_amount_msat(tmpctx, stats.gossip_known.capacity), - fmt_amount_msat(tmpctx, stats.total.capacity)); + return rq_log(ctx, rq, LOG_DBG, + NO_USABLE_PATHS_STRING + " Missing gossip for %s: only known %zu/%zu channels, leaving capacity only %s of %s.", + name, + stats.gossip_known.num_channels, + stats.total.num_channels, + fmt_amount_msat(tmpctx, stats.gossip_known.capacity), + fmt_amount_msat(tmpctx, stats.total.capacity)); } if (amount_msat_greater(amount, stats.enabled.capacity)) { - return tal_fmt(ctx, - NO_USABLE_PATHS_STRING - " The %s has disabled %zu of %zu channels, leaving capacity only %s of %s.", - name, - stats.total.num_channels - stats.enabled.num_channels, - stats.total.num_channels, - fmt_amount_msat(tmpctx, stats.enabled.capacity), - fmt_amount_msat(tmpctx, stats.total.capacity)); + return rq_log(ctx, rq, LOG_DBG, + NO_USABLE_PATHS_STRING + " The %s has disabled %zu of %zu channels, leaving capacity only %s of %s.", + name, + stats.total.num_channels - stats.enabled.num_channels, + stats.total.num_channels, + fmt_amount_msat(tmpctx, stats.enabled.capacity), + fmt_amount_msat(tmpctx, stats.total.capacity)); } return NULL; }