Include the wallet name in log messages relating to wallets #11320

pull dooglus wants to merge 1 commits into bitcoin:master from dooglus:wallet_name_in_log changing 5 files +50 −49
  1. dooglus commented at 3:28 pm on September 13, 2017: contributor
    For #11317.
  2. dooglus force-pushed on Sep 13, 2017
  3. promag commented at 7:43 pm on September 13, 2017: member

    How about something along one of these:

    • WalletLogPrintf(pwallet, ...);
    • pwallet->LogPrintf(...);
  4. fanquake added the label Wallet on Sep 14, 2017
  5. jnewbery commented at 7:09 pm on September 14, 2017: member
    Tested ACK 9d68be4d868b31456bc22cb005c12ed650ca3ac0
  6. TheBlueMatt commented at 6:48 pm on September 15, 2017: member

    Do you want to include the wallet in the SELECTIONS debug prints? I dont really care either way cause it should be obvious, but for completeness figured I’d mention it.

    utACK 9d68be4d868b31456bc22cb005c12ed650ca3ac0. I don’t hugely care about having a WalletLogPrintf function/macro, its not all that different, but if you find it cleaner, do it.

  7. dooglus force-pushed on Sep 15, 2017
  8. Include the wallet name in log messages relating to wallets f197a4c515
  9. dooglus force-pushed on Sep 15, 2017
  10. dooglus commented at 7:52 pm on September 15, 2017: contributor

    I added the wallet name to the SELECTCOINS message, and in four other places:

    -        LogPrint(BCLog::RPC, "Bumping fee and discarding dust output\n");
    +        LogPrint(BCLog::RPC, "[%s] Bumping fee and discarding dust output\n", pWallet->GetName());
    
    -            LogPrintf("Error getting wallet database cursor\n");
    +            LogPrintf("[%s] Error getting wallet database cursor\n", pwallet->GetName());
    
    -                LogPrintf("Error reading next record from wallet database\n");
    +                LogPrintf("[%s] Error reading next record from wallet database\n", pwallet->GetName());
    
    -                LogPrintf("%s\n", strErr);
    +                LogPrintf("[%s] %s\n", pwallet->GetName(), strErr);
    

    then rebased.

  11. in src/wallet/db.cpp:231 in f197a4c515
    228@@ -229,7 +229,7 @@ bool CDB::Recover(const std::string& filename, void *callbackDataIn, bool (*reco
    229 bool CDB::VerifyEnvironment(const std::string& walletFile, const fs::path& dataDir, std::string& errorStr)
    230 {
    231     LogPrintf("Using BerkeleyDB version %s\n", DbEnv::version(0, 0, 0));
    


    jonasschnelli commented at 3:01 am on September 16, 2017:
    Not really related, but this gets logged by -wallet instance? Maybe a better approach would be to do a single "Using wallets [x,y,z]\n" would be better?
  12. jonasschnelli commented at 3:05 am on September 16, 2017: contributor
    utACK f197a4c515757262eda0accbe762e311335be11b I think we should be careful with adding more direct access to pWalletsince we are planing to add dynamic loading/unloading.
  13. laanwj commented at 1:57 pm on September 26, 2017: member

    Concept ACK. We probably want to wait to merge this until 0.15.1/segwit wallet is released to prevent rebasing issues due to logging.

    I think we should be careful with adding more direct access to pWalletsince we are planing to add dynamic loading/unloading.

    Agree here.

  14. laanwj added this to the milestone 0.16.0 on Sep 26, 2017
  15. luke-jr commented at 9:37 am on November 10, 2017: member
    Concept ACK. I like pwallet->LogPrintf(...);
  16. sipa commented at 12:47 pm on January 6, 2018: member
    Concept ACK. I doubt this will interfere much with #11403, but I don’t mind rebasing if that’s a concern.
  17. laanwj removed this from the milestone 0.16.0 on Jan 11, 2018
  18. laanwj added this to the milestone 0.17.0 on Jan 11, 2018
  19. in src/wallet/wallet.cpp:1571 in f197a4c515
    1567@@ -1568,16 +1568,16 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool f
    1568         fAbortRescan = false;
    1569         fScanningWallet = true;
    1570 
    1571-        ShowProgress(_("Rescanning..."), 0); // show rescan progress in GUI as dialog or on splashscreen, if -rescan on startup
    1572+        ShowProgress(strprintf(_("[%s] Rescanning..."), GetName()), 0); // show rescan progress in GUI as dialog or on splashscreen, if -rescan on startup
    


    PierreRochard commented at 9:21 pm on February 12, 2018:
    The ShowProgress in line 490 of rpcdump for import wallet ( https://github.com/dooglus/bitcoin/blob/f197a4c515757262eda0accbe762e311335be11b/src/wallet/rpcdump.cpp#L490 )was not modified to indicate the wallet name, I thought it was deliberate due to the difference between GUI and log, but then saw this.
  20. PierreRochard commented at 6:00 pm on April 12, 2018: contributor
    @dooglus this is a good PR with unanimous concept ACKs, do you mind if I rebase your commit in a new PR so that we can get it in for 0.17?
  21. dooglus commented at 3:17 pm on April 13, 2018: contributor
    @PierreRochard I don’t mind at all. Please do so.
  22. MarcoFalke closed this on Apr 15, 2018

  23. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-07-05 22:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me