From fa1c5cc9df116411edca172f8b80fc225c776554 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 22 Mar 2024 10:29:18 +0100 Subject: [PATCH] fees: Log non-fatal errors as [warning], instead of info-level Also, remove not needed and possibly redundant function name and class names from the log string. Also, minimally reword the log messages. Also, remove redundant trailing newlines from log messages, while touching. --- src/policy/fees.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp index 143a3d6171f..e85b2f2caaa 100644 --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -979,7 +979,7 @@ bool CBlockPolicyEstimator::Write(AutoFile& fileout) const longStats->Write(fileout); } catch (const std::exception&) { - LogPrintf("CBlockPolicyEstimator::Write(): unable to write policy estimator data (non-fatal)\n"); + LogWarning("Unable to write policy estimator data (non-fatal)"); return false; } return true; @@ -992,7 +992,7 @@ bool CBlockPolicyEstimator::Read(AutoFile& filein) int nVersionRequired, dummy; filein >> nVersionRequired >> dummy; if (nVersionRequired > CURRENT_FEES_FILE_VERSION) { - throw std::runtime_error(strprintf("up-version (%d) fee estimate file", nVersionRequired)); + throw std::runtime_error{strprintf("File version (%d) too high to be read.", nVersionRequired)}; } // Read fee estimates file into temporary variables so existing data @@ -1001,7 +1001,7 @@ bool CBlockPolicyEstimator::Read(AutoFile& filein) filein >> nFileBestSeenHeight; if (nVersionRequired < CURRENT_FEES_FILE_VERSION) { - LogPrintf("%s: incompatible old fee estimation data (non-fatal). Version: %d\n", __func__, nVersionRequired); + LogWarning("Incompatible old fee estimation data (non-fatal). Version: %d", nVersionRequired); } else { // nVersionRequired == CURRENT_FEES_FILE_VERSION unsigned int nFileHistoricalFirst, nFileHistoricalBest; filein >> nFileHistoricalFirst >> nFileHistoricalBest; @@ -1041,7 +1041,7 @@ bool CBlockPolicyEstimator::Read(AutoFile& filein) } } catch (const std::exception& e) { - LogPrintf("CBlockPolicyEstimator::Read(): unable to read policy estimator data (non-fatal): %s\n",e.what()); + LogWarning("Unable to read policy estimator data (non-fatal): %s", e.what()); return false; } return true;