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.
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.
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.
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
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.
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)";
µNit:
#ifdef DEBUG
const std::string version_string = FormatFullVersion() + " (debug build)";
#else
const std::string version_string = FormatFullVersion() + " (release build)";
#endif
Meh, I prefer it this way.
Concept ACK.
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);
Should say "Bitcoin Core" according to the rebranding 4 years ago: #3408
I didn't introduce this message here, but sure, can update this.
I've changed it to use PACKAGE_NAME (which is Bitcoin Core), same as for the --help messages.
Will test after squash
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-----
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.