Log env path in BerkeleyEnvironment::Flush #14760

pull promag wants to merge 1 commits into bitcoin:master from promag:2018-11-logmultienvflush changing 1 files +1 −1
  1. promag commented at 4:03 PM on November 19, 2018: member

    With bitcoind -regtest -wallet=w1 -wallet=w2 -debug, before:

    BerkeleyEnvironment::Flush: Flush(true)
    BerkeleyEnvironment::Flush: Flushing wallet.dat (refcount = 0)...
    BerkeleyEnvironment::Flush: wallet.dat checkpoint
    BerkeleyEnvironment::Flush: wallet.dat detach
    BerkeleyEnvironment::Flush: wallet.dat closed
    BerkeleyEnvironment::Flush: Flush(true) took              23ms
    BerkeleyEnvironment::Flush: Flush(true)
    BerkeleyEnvironment::Flush: Flushing wallet.dat (refcount = 0)...
    BerkeleyEnvironment::Flush: wallet.dat checkpoint
    BerkeleyEnvironment::Flush: wallet.dat detach
    BerkeleyEnvironment::Flush: wallet.dat closed
    BerkeleyEnvironment::Flush: Flush(true) took              19ms
    

    After:

    BerkeleyEnvironment::Flush: [/Users/joao/Library/Application Support/Bitcoin/regtest/wallets/w1] Flush(true)
    BerkeleyEnvironment::Flush: Flushing wallet.dat (refcount = 0)...
    BerkeleyEnvironment::Flush: wallet.dat checkpoint
    BerkeleyEnvironment::Flush: wallet.dat detach
    BerkeleyEnvironment::Flush: wallet.dat closed
    BerkeleyEnvironment::Flush: Flush(true) took              23ms
    BerkeleyEnvironment::Flush: [/Users/joao/Library/Application Support/Bitcoin/regtest/wallets/w2] Flush(true)
    BerkeleyEnvironment::Flush: Flushing wallet.dat (refcount = 0)...
    BerkeleyEnvironment::Flush: wallet.dat checkpoint
    BerkeleyEnvironment::Flush: wallet.dat detach
    BerkeleyEnvironment::Flush: wallet.dat closed
    BerkeleyEnvironment::Flush: Flush(true) took              19ms
    
  2. Log env path in BerkeleyEnvironment::Flush 4674610300
  3. promag commented at 4:04 PM on November 19, 2018: member

    Not sure the best format, or if it should be in every line, but reading the current output is very confusing, wallet.dat everywhere..

  4. meshcollider added the label Wallet on Nov 19, 2018
  5. in src/wallet/db.cpp:695 in 4674610300
     691 | @@ -692,7 +692,7 @@ void BerkeleyEnvironment::Flush(bool fShutdown)
     692 |  {
     693 |      int64_t nStart = GetTimeMillis();
     694 |      // Flush log data to the actual data file on all files that are not in use
     695 | -    LogPrint(BCLog::DB, "BerkeleyEnvironment::Flush: Flush(%s)%s\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " database not started");
     696 | +    LogPrint(BCLog::DB, "BerkeleyEnvironment::Flush: [%s] Flush(%s)%s\n", strPath, fShutdown ? "true" : "false", fDbEnvInit ? "" : " database not started");
    


    practicalswift commented at 12:41 PM on November 20, 2018:

    Perhaps change the order so that that the general part of the message comes before the environment specific part of the message in order to increase readability?

    That is change from …

    BerkeleyEnvironment::Flush: [/Users/joao/Library/Application Support/Bitcoin/regtest/wallets/w1] Flush(true)
    

    … to say …

    BerkeleyEnvironment::Flush: Flush(true), file: /Users/joao/Library/Application Support/Bitcoin/regtest/wallets/w1
    

    laanwj commented at 10:34 AM on December 4, 2018:

    nah, context before message, message before context, you could make a valid point to go either way

  6. practicalswift commented at 12:44 PM on November 20, 2018: contributor

    utACK 4674610300d9b61badc3ded6cdda0e22ee31524d modulo nit

  7. laanwj commented at 11:10 AM on November 23, 2018: member

    utACK—yes why not I think it would be nice to have a consistent format for wallet-related logging, specifying what wallet every log message related to, but I also understand that this is difficult to mesh with the current design, and this is an improvement.

  8. jonasschnelli commented at 5:48 AM on November 25, 2018: contributor

    utACK 4674610300d9b61badc3ded6cdda0e22ee31524d

  9. laanwj merged this on Dec 4, 2018
  10. laanwj closed this on Dec 4, 2018

  11. laanwj referenced this in commit c789add6fc on Dec 4, 2018
  12. jasonbcox referenced this in commit 8915b2f748 on Oct 25, 2019
  13. PastaPastaPasta referenced this in commit 123c1f511b on Jun 27, 2021
  14. PastaPastaPasta referenced this in commit b97e871f58 on Jun 28, 2021
  15. PastaPastaPasta referenced this in commit 826470b403 on Jun 29, 2021
  16. PastaPastaPasta referenced this in commit 8bc8f8942c on Jul 1, 2021
  17. PastaPastaPasta referenced this in commit d5515d321d on Jul 1, 2021
  18. PastaPastaPasta referenced this in commit c7e7d1e351 on Jul 1, 2021
  19. UdjinM6 referenced this in commit 515df7b379 on Jul 5, 2021
  20. UdjinM6 referenced this in commit 55e97a5aec on Jul 5, 2021
  21. MarcoFalke 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: 2026-05-11 18:15 UTC

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