Skip to content

test: Remove spam from debug log - #26408

Merged
maflcko merged 1 commit into
bitcoin:masterfrom
jbrr:2210-fix-noisy-tests
Oct 29, 2022
Merged

test: Remove spam from debug log#26408
maflcko merged 1 commit into
bitcoin:masterfrom
jbrr:2210-fix-noisy-tests

Conversation

@jbrr

@jbrr jbrr commented Oct 28, 2022

Copy link
Copy Markdown
Contributor

Currently, debug.log is spammed with messages like this from random.cpp when functional tests are run.

2022-10-25T19:24:34.787663Z [scheduler] [random.cpp:519] [SeedPeriodic] [rand] Feeding 36565 bytes of dynamic environment data into RNG

These logs are not useful for debugging and decrease the signal-to-noise ratio of the logs, so they should be suppressed by excluding the rand category, as the libevent and leveldb categories currently are.

Currently, debug.log is spammed with messages from random.cpp
when functional tests are run. These logs are not useful for
debugging, and decrease the signal to noise ratio of the logs.
@DrahtBot DrahtBot added the Tests label Oct 28, 2022
@LarryRuane

LarryRuane commented Oct 28, 2022

Copy link
Copy Markdown
Contributor

ACK ef97b89
Tested that the patch does eliminate the logging lines quoted in the description. I think this is a useful change because those log entries add little to no value. Eliminating them makes the logs easier to read when writing or understanding functional tests (I do this often myself).

@kouloumos

Copy link
Copy Markdown
Contributor

ACK ef97b89, confirmed that this log level is only used in random.cpp and indeed it seems that it doesn't add any value to the debug.log during functional tests.

@satsie

satsie commented Oct 28, 2022

Copy link
Copy Markdown
Contributor

ACK ef97b89

Confirmed what kouloumos said about this log level only appearing in random.cpp:

grep -r -i --color='always' 'BCLog::RAND' .
./bitcoin/src/logging.cpp:    {BCLog::RAND, "rand"},
./bitcoin/src/random.cpp:    LogPrint(BCLog::RAND, "Feeding %i bytes of dynamic environment data into RNG\n", hasher.Size() - old_size);
./bitcoin/src/random.cpp:    LogPrint(BCLog::RAND, "Feeding %i bytes of environment data into RNG\n", hasher.Size() - old_size);

Applied the code change an observed that the rand debug logs are no longer appearing for bitcoind instances that the functional tests start up. Suppressing them feels like a good idea because it makes the debug logs easier to read. The likelihood that someone needs these log statements for testing is very small compared to the amount of the tests where these log messages are just noise.

@theStack theStack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK ef97b89

Verified the effect of the PR by running ./test/functional/p2p_segwit.py --nocleanup and comparing debug.log files (on the short-running tests there was no difference). Also checked that the debug messages belonging to the excluded RAND category are indeed not needed for analyzing functional tests.

Warm welcome as a new contributor!

@maflcko
maflcko merged commit 984a015 into bitcoin:master Oct 29, 2022
@jbrr

jbrr commented Oct 31, 2022

Copy link
Copy Markdown
Contributor Author

Thanks for all the quick feedback, and thanks for the warm welcome @theStack!

"-debug",
"-debugexclude=libevent",
"-debugexclude=leveldb",
"-debugexclude=rand",

@jonatack jonatack Nov 2, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, debug.log is spammed with messages like this from random.cpp when functional tests are run.

These logs are not useful for debugging and decrease the signal-to-noise ratio of the logs, so they should be suppressed by excluding the rand category, as the libevent and leveldb categories currently are.

Note that the libevent and leveldb categories are external libraries, whereas src/random.{h,cpp} is logging from our own code.

@bitcoin bitcoin locked and limited conversation to collaborators Nov 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants