@ryanofsky, thanks, I like that much better. I implemented your suggestion (with a small difference, only a single call to LogPrintf()
), rebased, squashed, force-pushed (eb973ff916f88ed36b59ae6466ec16dd30811215). The formatting is slightly different now, but I like that the code is much simpler and the output is more consistent (this is from one of the functional tests):
02019-11-26T16:09:54.048744Z [init] config-file arg: regtest="1"
12019-11-26T16:09:54.048755Z [init] config-file arg: [regtest] bind="127.0.0.1"
22019-11-26T16:09:54.048765Z [init] config-file arg: [regtest] discover="0"
32019-11-26T16:09:54.048774Z [init] config-file arg: [regtest] dnsseed="0"
42019-11-26T16:09:54.048784Z [init] config-file arg: [regtest] fallbackfee="0.0002"
52019-11-26T16:09:54.048793Z [init] config-file arg: [regtest] keypool="1"
62019-11-26T16:09:54.048802Z [init] config-file arg: [regtest] listenonion="0"
72019-11-26T16:09:54.048812Z [init] config-file arg: [regtest] port="11068"
82019-11-26T16:09:54.048822Z [init] config-file arg: [regtest] printtoconsole="0"
92019-11-26T16:09:54.048833Z [init] config-file arg: [regtest] rpcport="16068"
102019-11-26T16:09:54.048843Z [init] config-file arg: [regtest] server="1"
112019-11-26T16:09:54.048854Z [init] config-file arg: [regtest] shrinkdebugfile="0"
122019-11-26T16:09:54.048865Z [init] config-file arg: [regtest] upnp="0"
132019-11-26T16:09:54.048874Z [init] command-line arg: datadir="/tmp/bitcoin_func_test_wmar_kd1/node0"
142019-11-26T16:09:54.048884Z [init] command-line arg: debug=""
152019-11-26T16:09:54.048895Z [init] command-line arg: debugexclude="libevent"
162019-11-26T16:09:54.048904Z [init] command-line arg: debugexclude="leveldb"
172019-11-26T16:09:54.048914Z [init] command-line arg: logthreadnames=""
182019-11-26T16:09:54.048924Z [init] command-line arg: logtimemicros=""
192019-11-26T16:09:54.048934Z [init] command-line arg: uacomment="testnode0"
I like the way negative arguments are displayed; as you say, they are less ambiguous. There are no examples of such from above, but I ran src/bitcoind -noreindex
and the following appears in debug.log
:
02019-11-26T17:00:24Z command-line arg: reindex=false
I added a unit test for this too. Thank you for taking the time to review!