test: Replace DEBUG_LOG_OUT with -printtoconsole=1 #34926

pull hodlinator wants to merge 1 commits into bitcoin:master from hodlinator:2026/03/rm_DEBUG_LOG_OUT changing 7 files +1 −23
  1. hodlinator commented at 1:46 pm on March 26, 2026: contributor

    -printtoconsole=1 has the same functionality but works in more cases than DEBUG_LOG_OUT, so remove the latter (-printtoconsole is already used when fuzzing). This means we can drop G_TEST_LOG_FUN.


    Behavior can be verified through

    0ctest --test-dir build --debug
    

    and checking for:

    0142: Test command: /home/hodlinator/bc/2/build/bin/test_bitcoin "--run_test=coinselector_tests" "--catch_system_error=no" "--log_level=test_suite" "--" "-printtoconsole=1"
    1...
    2142: 2026-03-26T13:40:02.169392Z [test] [../src/kernel/context.cpp:20] [operator()] Using the 'sse4(1way);sse41(4way);avx2(8way)' SHA256 implementation
    

    Inspired by: #34918 (review)

  2. test: Replace DEBUG_LOG_OUT with -printtoconsole=1 261d229455
  3. DrahtBot added the label Tests on Mar 26, 2026
  4. DrahtBot commented at 1:46 pm on March 26, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK nkatha23, maflcko, janb84, kevkevinpal

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  5. nkatha23 commented at 8:10 am on March 27, 2026: none

    Tested on 261d229. Verified via ctest –test-dir build –debug:

    • All 155 test commands show -printtoconsole=1 replacing DEBUG_LOG_OUT
    • Log output confirmed flowing through — Using the ‘sse4(1way);sse41(4way);avx2(8way)’ SHA256 implementation appears across multiple tests
    • git grep DEBUG_LOG_OUT returns no results

    The custom G_TEST_LOG_FUN callback infrastructure existed solely to support DEBUG_LOG_OUT removing both together is clean. -printtoconsole=1 achieves the same result through the native logging system without needing a custom callback registered in BasicTestingSetup, and without stub definitions scattered across bench, qt, and fuzz binaries.

    ACK 261d229

  6. maflcko commented at 1:56 pm on March 27, 2026: member

    review ACK 261d229455e30fee874a5215a618adf6210cbe3a 📬

    Signature:

    0untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
    1RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
    2trusted comment: review ACK 261d229455e30fee874a5215a618adf6210cbe3a 📬
    336QypMYwc9zvsj/CWOYhacgqUUQGhtxzQJKevL4Wc4bLcOaFoh0B2Ty/vdWb+Qn5BeqeAv1QHD9oRFtSNYV+Dw==
    

    Looks like this was introduced in fa37e0a68bea65979f9f8f2e5258fe608acf2bdf, to “Show debug log on unit test failure”.

    Looks like it could have been removed any time after commit 92a0f7e58d4b6323d21f1c45d4c20266c35df030, which added command line args parsing.

    While reviewing that commit, I left a confusing comment in #23373 (review), and again in #34918 (review).

    Seems best to remove now after all those years.

  7. janb84 commented at 2:23 pm on March 27, 2026: contributor

    cr ACK 261d229455e30fee874a5215a618adf6210cbe3a

    Interesting history, introduced in #16975 to log to boost log changed in #18472 to fix a bug now logs to unit_test.log. #23373 made the –printtoconsole option possible and not sure what the code adds this day.

    Cannot find a reason why to keep old solution, maybe a CI quirk ? But is seems good to remove to me

  8. kevkevinpal commented at 4:31 pm on March 27, 2026: contributor

    crACK 261d229

    I tested to make sure we don’t see DEBUG_LOG_OUT and we now see -printtoconsole=1 instead.

    This is a good cleanup and makes sense to remove since it isn’t needed.

    I also did a quick grep for G_TEST_LOG_FUN and didn’t see any uses of it elsewhere after this commit

  9. fanquake merged this on Mar 28, 2026
  10. fanquake closed this on Mar 28, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-03-31 12:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me