Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripted-diff: Use LogInfo over LogPrintf [WIP, NOMERGE, DRAFT] #29641

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Mar 12, 2024

LogPrintf has many issues:

  • It does not mention the log severity (info).
  • It is a deprecated alias for LogInfo, according to the dev notes.
  • It wastes review cycles, because reviewers sometimes point out that it is deprecated.

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 12, 2024

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

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/29641.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept ACK TheCharlatan, l0rinc
Stale ACK kevkevinpal

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #31490 (refactor: cache block[undo] serialized size for consecutive calls by l0rinc)
  • #31483 (kernel: Move kernel-related cache constants to kernel cache by TheCharlatan)
  • #31423 (wallet: migration, don't create spendable wallet from a watch-only legacy wallet by furszy)
  • #31384 (mining: bugfix: Fix duplicate coinbase tx weight reservation by ismaelsadeeq)
  • #31144 (optimization: batch XOR operations 12% faster IBD by l0rinc)
  • #30610 (validation: do not wipe utxo cache for stats/scans/snapshots by sipa)
  • #30529 (Fix -norpcwhitelist, -norpcallowip, and similar corner case behavior by ryanofsky)
  • #30343 (wallet, logging: Replace WalletLogPrintf() with LogInfo() by ryanofsky)
  • #29640 (Fix tiebreak when loading blocks from disk (and add tests for comparing chain ties) by sr-gi)
  • #29307 (util: explicitly close all AutoFiles that have been written by vasild)
  • #29256 (Improve new LogDebug/Trace/Info/Warning/Error Macros by ryanofsky)
  • #28710 (Remove the legacy wallet and BDB dependency by achow101)
  • #28584 (Fuzz: extend CConnman tests by vasild)
  • #27826 (validation: log which peer sent us a header by Sjors)
  • #26022 (Add util::ResultPtr class by ryanofsky)
  • #25722 (refactor: Use util::Result class for wallet loading by ryanofsky)
  • #25665 (refactor: Add util::Result failure values, multiple error and warning messages by ryanofsky)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@kevkevinpal
Copy link
Contributor

concept ACK fae5751

@kevkevinpal
Copy link
Contributor

I noticed that there are helper functions such as the following using the LogPrintf naming scheme

  • WalletLogPrintf in src/wallet/wallet.h
  • LogPrintfCategoryWithThreadNames, LogPrintfCategory, LogPrintfCategoryWithoutThreadNames, LogPrintfWithoutThreadNames, LogPrintfWithThreadNames in ./src/bench/logging.cpp

Using this grep grep -nri "\<LogPrintLevel\>" ./src --binary-files=without-match
I also noticed that we are using LogPrintLevel when we could be using LogInfo, LogWarning, LogError, LogDebug and LogTrace

these might want to be addressed in a separate PR though

@maflcko maflcko force-pushed the 2403-log- branch 2 times, most recently from 19fc4eb to cfd07d1 Compare November 21, 2024 10:51
@@ -109,7 +109,8 @@ jobs:
run: |
# A workaround for "The `brew link` step did not complete successfully" error.
brew install --quiet python@3 || brew link --overwrite python@3
brew install --quiet coreutils ninja pkg-config gnu-getopt ccache boost libevent zeromq qt@5 qrencode
brew unlink pkg-config
brew install --quiet coreutils ninja gnu-getopt ccache boost libevent zeromq qt@5 qrencode
Copy link
Member

Choose a reason for hiding this comment

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

forgot to add pkgconf?

@DrahtBot
Copy link
Contributor

Guix builds (on x86_64) [untrusted test-only build, possibly unsafe, not for production use]

File commit 144f98d
(master)
commit 7a4af2b
(master and this pull)
SHA256SUMS.part 1c004827138ad8a3... 02a507287cbc2ec9...
*-aarch64-linux-gnu-debug.tar.gz 4f390b9052bee4eb... 2530fbb6b6728af6...
*-aarch64-linux-gnu.tar.gz 6f9e3bc3176b932c... 206798944f0ca6bd...
*-arm-linux-gnueabihf-debug.tar.gz 2bc81317aafce85f... 06e809f8524ee22a...
*-arm-linux-gnueabihf.tar.gz 8e54bb98ef268e66... f1e8e7ed781d9728...
*-arm64-apple-darwin-unsigned.tar.gz 760ff2eff02bb070... fddc9f74cc5cd479...
*-arm64-apple-darwin-unsigned.zip aeb60be790e2b8f3... 1d68bde83e62a413...
*-arm64-apple-darwin.tar.gz cb6f5d76ee3dda4f... 2ad15cc1018a8b29...
*-powerpc64-linux-gnu-debug.tar.gz 4a8daf44ebe9714e... 9d11157e0d086977...
*-powerpc64-linux-gnu.tar.gz 030347c206f6d8ef... 16f238a750613fce...
*-riscv64-linux-gnu-debug.tar.gz 373b3273685e4d51... 2a4aa5bad8612e6d...
*-riscv64-linux-gnu.tar.gz e9be777ab634838f... 6f938de398963d53...
*-x86_64-apple-darwin-unsigned.tar.gz fb7477fd0c2531d0... 3ce7528226fe9fe5...
*-x86_64-apple-darwin-unsigned.zip 9c45cc0383b71309... 970eba0c751f91c5...
*-x86_64-apple-darwin.tar.gz 5601d925876fd50a... 3479956bc59b7acf...
*-x86_64-linux-gnu-debug.tar.gz d18f37f54bf31654... 9e799c33ec810764...
*-x86_64-linux-gnu.tar.gz 7f9028b87f0ff7e8... 36607df6e962fbfa...
*.tar.gz ad7543a15fee40fe... 1fb69a13f48ea83b...
guix_build.log bfede8657a978bd6... 86c8239909dd5c6d...
guix_build.log.diff 7a0df0371fb92b57...

@DrahtBot
Copy link
Contributor

Guix builds (on x86_64) [untrusted test-only build, possibly unsafe, not for production use]

File commit 22723c8
(master)
commit 8160e11
(master and this pull)
SHA256SUMS.part 9f62b39763c37372... 6f4643c09b4a08a7...
*-aarch64-linux-gnu-debug.tar.gz de1ca4d38be6158f... 7cdb07136c161db4...
*-aarch64-linux-gnu.tar.gz 65e51aff97fbd383... e549909863348352...
*-arm-linux-gnueabihf-debug.tar.gz 4bbc38eac723fb02... c1e95cd83abfd84c...
*-arm-linux-gnueabihf.tar.gz 16c178e224449c6f... 4ad24c6272053ea6...
*-arm64-apple-darwin-unsigned.tar.gz 4d7781dd06264c88... 296554aac939aa81...
*-arm64-apple-darwin-unsigned.zip ea6c5a60996c003a... 5ab183e6e007ffd3...
*-arm64-apple-darwin.tar.gz bfce458364631d02... dd29e60ac23ed8e6...
*-powerpc64-linux-gnu-debug.tar.gz 05f0daf8e1bc09e5... 12b14a9ed348b505...
*-powerpc64-linux-gnu.tar.gz f3665dc6745666d8... 069b314f355931f6...
*-riscv64-linux-gnu-debug.tar.gz 798cb191cce683f7... abdf79b769297d0b...
*-riscv64-linux-gnu.tar.gz fd5703407bf26dd7... d5a1a63d5b802883...
*-x86_64-apple-darwin-unsigned.tar.gz d2f432f3aa99a5a5... 372f17632d548386...
*-x86_64-apple-darwin-unsigned.zip 01974c25640fd599... da00421d29b6ef02...
*-x86_64-apple-darwin.tar.gz 91a46abb27c44ee5... a015f1148c8426bd...
*-x86_64-linux-gnu-debug.tar.gz a463ef88e05bcdc3... bf6c4148b5327b42...
*-x86_64-linux-gnu.tar.gz 793cc9fbf1a319fc... da68d7a29c87a91f...
*.tar.gz 478531d86c4e0bfa... 9106bc777d1074b1...
guix_build.log f7c69749ca6bde97... 1634a4f619597adb...
guix_build.log.diff b892903a164121fa...

MarcoFalke added 2 commits January 2, 2025 19:24
-BEGIN VERIFY SCRIPT-
 sed -i 's/\<LogPrintf\>/LogInfo/g' $( git grep -l '\<LogPrintf\>' -- ./contrib/ ./src/ ./test/ ':(exclude)src/logging.h' )
-END VERIFY SCRIPT-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants