dash/test/functional/test_framework
Wladimir J. van der Laan 4774e1e8f6
Merge #19809: log: Prefix log messages with function name and source code location if -logsourcelocations is set
b4511e2e2ed1a6077ae6826a9ee6b7a311293d08 log: Prefix log messages with function name if -logsourcelocations is set (practicalswift)

Pull request description:

  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:

  ```
  $ src/bitcoind -regtest
  2020-08-25T03:29:04Z Using RdRand as an additional entropy source
  2020-08-25T03:29:04Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
  2020-08-25T03:29:04Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
  2020-08-25T03:29:04Z Loaded best chain: hashBestChain=0fff88f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e22ff height=0 date=2011-02-02T23:16:42Z progress=1.000000
  2020-08-25T03:29:04Z block tree size = 1
  2020-08-25T03:29:04Z nBestHeight = 0
  2020-08-25T03:29:04Z Imported mempool transactions from disk: 0 succeeded, 0 failed, 0 expired, 0 already there, 0 waiting for initial broadcast
  2020-08-25T03:29:04Z 0 addresses found from DNS seeds
  ```

  With `-logthreadnames` and `-logfunctionnames`:

  ```
  $ src/bitcoind -regtest -logthreadnames -logfunctionnames
  2020-08-25T03:29:04Z [init] [ReportHardwareRand] Using RdRand as an additional entropy source
  2020-08-25T03:29:04Z [init] [InitSignatureCache] Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
  2020-08-25T03:29:04Z [init] [InitScriptExecutionCache] Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
  2020-08-25T03:29:04Z [init] [LoadChainTip] Loaded best chain: hashBestChain=0fff88f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e22ff height=0 date=2011-02-02T23:16:42Z progress=1.000000
  2020-08-25T03:29:04Z [init] [AppInitMain] block tree size = 1
  2020-08-25T03:29:04Z [init] [AppInitMain] nBestHeight = 0
  2020-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
  2020-08-25T03:29:04Z [dnsseed] [ThreadDNSAddressSeed] 0 addresses found from DNS seeds
  ```

ACKs for top commit:
  laanwj:
    Code review ACK b4511e2e2ed1a6077ae6826a9ee6b7a311293d08
  MarcoFalke:
    review ACK b4511e2e2ed1a6077ae6826a9ee6b7a311293d08 🌃

Tree-SHA512: d100f5364630c323f31d275259864c597f7725e462d5f4bdedcc7033ea616d7fc0d16ef1b2af557e692f4deea73c6773ccfc681589e7bf6ba970b9ec169040c7
2024-04-11 02:25:08 +07:00
..
crypto merge bitcoin#28374: python cryptography required for BIP 324 functional tests 2024-03-05 21:43:22 +00:00
__init__.py
address.py Merge #19253: Tests: tidy up address.py and segwit_addr.py 2024-04-10 01:58:59 +07:00
authproxy.py
bip340_test_vectors.csv partial bitcoin#19953: Implement BIP 340-342 validation 2024-02-19 10:17:10 -06:00
blockfilter.py merge bitcoin#28374: python cryptography required for BIP 324 functional tests 2024-03-05 21:43:22 +00:00
blocktools.py Merge #16551: test: Test that low difficulty chain fork is rejected 2024-04-03 14:16:43 +07:00
coverage.py
descriptors.py
key.py Merge #19239: tests: move generate_wif_key to wallet_util.py 2024-03-09 03:00:27 +07:00
messages.py Merge #20993: test: store subversion (user agent) as string in msg_version 2024-04-11 02:25:08 +07:00
netutil.py partial bitcoin#20842: consolidate typo & url fixing 2024-02-19 10:17:12 -06:00
p2p.py Merge #20993: test: store subversion (user agent) as string in msg_version 2024-04-11 02:25:08 +07:00
script_util.py Merge #18788: tests: Update more tests to work with descriptor wallets 2024-03-09 03:01:24 +07:00
script.py merge bitcoin#28374: python cryptography required for BIP 324 functional tests 2024-03-05 21:43:22 +00:00
socks5.py
test_framework.py Merge bitcoin/bitcoin#22257: test: refactor: various (de)serialization helpers cleanups/improvements 2024-03-22 10:29:15 -05:00
test_node.py Merge #19809: log: Prefix log messages with function name and source code location if -logsourcelocations is set 2024-04-11 02:25:08 +07:00
test_shell.py
util.py merge bitcoin#21254: Avoid connecting to real network when running tests 2024-03-25 11:55:07 +00:00
wallet_util.py Merge #19239: tests: move generate_wif_key to wallet_util.py 2024-03-09 03:00:27 +07:00
wallet.py