Skip to content

Conversation

@jbrr
Copy link
Contributor

@jbrr jbrr commented Oct 28, 2022

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
Copy link
Contributor

LarryRuane commented Oct 28, 2022

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
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
Copy link
Contributor

satsie commented Oct 28, 2022

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.

Copy link
Contributor

@theStack theStack left a comment

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
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 30, 2022
ef97b89 Exclude rand from debug log (Jeff Ruane)

Pull request description:

  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.

ACKs for top commit:
  LarryRuane:
    ACK ef97b89
  kouloumos:
     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:
    ACK ef97b89
  theStack:
    ACK ef97b89

Tree-SHA512: 5cea384a3197f0ec77efa9efc77822914450ecf5546606568bbd432c3536040c772c57aef58d3bb083a2e5e756f690766fa1fb382ab1973748db238108a58746
@jbrr
Copy link
Contributor Author

jbrr commented Oct 31, 2022

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

"-debug",
"-debugexclude=libevent",
"-debugexclude=leveldb",
"-debugexclude=rand",
Copy link
Member

@jonatack jonatack Nov 2, 2022

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