2918 | @@ -2919,9 +2919,15 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer)
2919 | const MempoolAcceptResult result = m_chainman.ProcessTransaction(porphanTx);
2920 | const TxValidationState& state = result.m_state;
2921 | const uint256& orphanHash = porphanTx->GetHash();
2922 | + const uint256& orphan_wtxid = porphanTx->GetWitnessHash();
2923 |
2924 | if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) {
2925 | - LogPrint(BCLog::MEMPOOL, " accepted orphan tx %s\n", orphanHash.ToString());
2926 | + LogPrint(BCLog::TXPACKAGES, " accepted orphan tx %s (wtxid=%s)\n", orphanHash.ToString(), orphan_wtxid.ToString());
2927 | + LogPrint(BCLog::MEMPOOL, "AcceptToMemoryPool: peer=%d: accepted %s (wtxid=%s) (poolsz %u txn, %u kB)\n",
For added or updated logging, it would help the migration to severity level logging if LogPrintLevel instead of LogPrint was used, either with debug or trace levels depending on e.g. log frequency.
For more context, LogPrintLevel may eventually become the principal or only logging macro, and at some point could be renamed to just Log, so using it for new logging would make the transition easier.
I'm not familiar with the migration you're referring to, could you link a PR/issue where I can see the changes and motivation? It's not clear to me why I should change this PR for it.
#25203 has been ongoing since a year and a half and several initial steps have been merged. The blocker since March has been #27231, though given how long it has remained open I'll probably begin to work around it.
By using the new macros, there is less to update later on, and you are able to decide now the log level per message of your added logging.
I'm going to leave this as is. It can very easily be changed later on if we decide on a logging api. Doesn't seem like there is consensus to do it in the #25203-style. This PR has 3 ACKs and would unblock package relay work.
Doesn't seem like there is consensus to do it in the #25203-style.
The suggested macro, LogPrintLevel, was merged 15 months ago in #24464.