Prefix log messages with function name if -logfunctionnames
is set.
Yes, exactly like -logthreadnames
but for function names instead of thread names :)
This is a small developer ergonomics improvement: I’ve found this to be a cheap/simple way to correlate log output and originating function.
For me it beats the ordinary cycle of 1.) try to figure out a regexp matching the static part of the dynamic log message, 2.) git grep -E 'Using .* MiB out of .* requested for signature cache'
, 3.) mcedit filename.cpp
(openemacs filename.cpp
works too!) and 4.) search for log message and scroll up to find the function name :)
Without any logging parameters:
0$ src/bitcoind -regtest
12020-08-25T03:29:04Z Using RdRand as an additional entropy source
22020-08-25T03:29:04Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
32020-08-25T03:29:04Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
42020-08-25T03:29:04Z Loaded best chain: hashBestChain=0fff88f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e22ff height=0 date=2011-02-02T23:16:42Z progress=1.000000
52020-08-25T03:29:04Z block tree size = 1
62020-08-25T03:29:04Z nBestHeight = 0
72020-08-25T03:29:04Z Imported mempool transactions from disk: 0 succeeded, 0 failed, 0 expired, 0 already there, 0 waiting for initial broadcast
82020-08-25T03:29:04Z 0 addresses found from DNS seeds
With -logthreadnames
and -logfunctionnames
:
0$ src/bitcoind -regtest -logthreadnames -logfunctionnames
12020-08-25T03:29:04Z [init] [ReportHardwareRand] Using RdRand as an additional entropy source
22020-08-25T03:29:04Z [init] [InitSignatureCache] Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
32020-08-25T03:29:04Z [init] [InitScriptExecutionCache] Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
42020-08-25T03:29:04Z [init] [LoadChainTip] Loaded best chain: hashBestChain=0fff88f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e22ff height=0 date=2011-02-02T23:16:42Z progress=1.000000
52020-08-25T03:29:04Z [init] [AppInitMain] block tree size = 1
62020-08-25T03:29:04Z [init] [AppInitMain] nBestHeight = 0
72020-08-25T03:29:04Z [loadblk] [LoadMempool] Imported mempool transactions from disk: 0 succeeded, 0 failed, 0 expired, 0 already there, 0 waiting for initial broadcast
82020-08-25T03:29:04Z [dnsseed] [ThreadDNSAddressSeed] 0 addresses found from DNS seeds