Log debug build status and warn when running benchmarks #12197

pull laanwj wants to merge 2 commits into bitcoin:master from laanwj:2018_01_debug_in_log changing 2 files +10 −1
  1. laanwj commented at 10:51 AM on January 16, 2018: member

    Log whether the starting instance of bitcoin core is a debug or release build (--enable-debug).

    Also warn when running the benchmarks with a debug build, to prevent mistakes comparing debug to non-debug results.

  2. Log debug build status and warn when running benchmarks
    Log whether the starting instance of bitcoin core is a debug or release
    build (--enable-debug).
    
    Also warn when running the benchmarks with a debug build, to prevent
    mistakes comparing debug to non-debug results.
    0c74e2e890
  3. laanwj added the label Utils/log/libs on Jan 16, 2018
  4. in src/init.cpp:812 in 0c74e2e890 outdated
     807 | @@ -808,7 +808,13 @@ void InitLogging()
     808 |      fLogIPs = gArgs.GetBoolArg("-logips", DEFAULT_LOGIPS);
     809 |  
     810 |      LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
     811 | -    LogPrintf("Bitcoin version %s\n", FormatFullVersion());
     812 | +    std::string version_string = FormatFullVersion();
     813 | +#ifdef DEBUG
    


    laanwj commented at 11:00 AM on January 16, 2018:

    Could move this into FormatFullVersion if we want it in all places where the version is printed, but I wasn't entirely sure about that being useful, the point is just to have this in the log for post-mortem analysis.

  5. in src/init.cpp:813 in 0c74e2e890 outdated
     807 | @@ -808,7 +808,13 @@ void InitLogging()
     808 |      fLogIPs = gArgs.GetBoolArg("-logips", DEFAULT_LOGIPS);
     809 |  
     810 |      LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
     811 | -    LogPrintf("Bitcoin version %s\n", FormatFullVersion());
     812 | +    std::string version_string = FormatFullVersion();
     813 | +#ifdef DEBUG
     814 | +    version_string += " (debug build)";
    


    promag commented at 11:18 AM on January 16, 2018:

    µNit:

    #ifdef DEBUG
        const std::string version_string = FormatFullVersion() + " (debug build)";
    #else
        const std::string version_string = FormatFullVersion() + " (release build)";
    #endif
    

    laanwj commented at 11:45 AM on January 16, 2018:

    Meh, I prefer it this way.

  6. promag commented at 11:19 AM on January 16, 2018: member

    Concept ACK.

  7. in src/init.cpp:817 in 0c74e2e890 outdated
     813 | +#ifdef DEBUG
     814 | +    version_string += " (debug build)";
     815 | +#else
     816 | +    version_string += " (release build)";
     817 | +#endif
     818 | +    LogPrintf("Bitcoin version %s\n", version_string);
    


    MarcoFalke commented at 12:49 PM on January 16, 2018:

    Should say "Bitcoin Core" according to the rebranding 4 years ago: #3408


    laanwj commented at 6:14 PM on January 18, 2018:

    I didn't introduce this message here, but sure, can update this.


    laanwj commented at 6:29 PM on January 18, 2018:

    I've changed it to use PACKAGE_NAME (which is Bitcoin Core), same as for the --help messages.

  8. MarcoFalke commented at 9:45 PM on January 18, 2018: member

    Will test after squash

  9. laanwj force-pushed on Jan 19, 2018
  10. Use PACKAGE_NAME instead of hardcoding application name in log message 34328b4980
  11. laanwj force-pushed on Jan 19, 2018
  12. MarcoFalke commented at 5:11 PM on January 23, 2018: member

    Works for me:

    ./src/qt/bitcoin-qt -printtoconsole|grep "Bitcoin Core"
    2018-01-23 17:08:21 Bitcoin Core version v0.15.99.0-a4057776c4-dirty (release build)
    
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    Tested ACK 34328b4980848bca372347c8680b94d9d02eca0a
    -----BEGIN PGP SIGNATURE-----
    
    iQIcBAEBCgAGBQJaZ2xYAAoJENLqSFDnUoslMDIP/3hG5gdV4ErYcur/NsYVqI+M
    oD4kABfyk+HDDka/h/ZXrA2Yt37z08Rit682nT2r4yf/ZHPZ/zH3B+vmFLkX/bml
    JQNQDYrncW7U6R9xaM49P6bLzL2JYN6wQ403lN9R3DXL7besMe5PlxpAvVf7gQ+u
    E44bFLGl//rG/rn5TdXiZaT697DMb07IDLwez/vpml+UrrQ47NAhFZ4zgpcUItUv
    1ClvFiBPMonXA6y/P8iMS++akOQjsQgjCcQXhiRwwwvJ4/PgB69HQnyL9SQztlQt
    bugLrEqkxHWHjO7LSAFrqAWPxAsHfCMKu/+Z41zcuGXscEdkF/cdhc5xJjlMt1l9
    xZZIpY1EpnG0AZSKO49foSxiOXJ3d1hzph7Dckt6jATooqUPkea0IEzlWx1Y00EY
    KZdtrsTMfYndlqF6x3aaZyzPd8Mtt6ZCcOf3VUMXdhoXB+B37NAVTvoLQ0g7bwmi
    g8oWpJOURbU9ciuZnSGiAG02x1Z46OD59C3G9GLr3Ho600E25nybqaIdNV0BK3Ps
    EGDpcWyioi15cV3KXZ113XBCDLCV1XfJpLD5OavWxHG6DnY77vtRfc+vhtzIJsD8
    EHHUwJ4JRBpELBmXzbs0MDWyCFtA4PZnAnHdiBmUYmabyS+E/3JpwJFF1kDj3SHz
    GuSlr/E1M7/2cGxuz7KK
    =GFqT
    -----END PGP SIGNATURE-----
    
  13. MarcoFalke commented at 7:03 PM on January 23, 2018: member

    Note that gcc yells at me for compiling with _FORTIFY_SOURCE (default to on when hardening) and --enable-debug. So maybe we should disable hardening for debug builds, but that clearly is out of scope for this pull request.

  14. laanwj merged this on Jan 29, 2018
  15. laanwj closed this on Jan 29, 2018

  16. laanwj referenced this in commit 000ac4fd01 on Jan 29, 2018
  17. jasonbcox referenced this in commit 81c6819f38 on Dec 20, 2019
  18. PastaPastaPasta referenced this in commit d26173fbcb on Jun 13, 2020
  19. PastaPastaPasta referenced this in commit 73193c7e8c on Jun 13, 2020
  20. PastaPastaPasta referenced this in commit cda702f451 on Jun 17, 2020
  21. PastaPastaPasta referenced this in commit fa9fbbaab0 on Jun 18, 2020
  22. gades referenced this in commit 65e484c5de on Jun 28, 2021
  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: 2026-04-13 15:15 UTC

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