Use method name via __func__ macro #10744

pull darksh1ne wants to merge 1 commits into bitcoin:master from darksh1ne:patch-2 changing 1 files +2 −2
  1. darksh1ne commented at 7:26 PM on July 4, 2017: contributor

    Use func macro in std::runtime_exception to:

    1. fix method name in CWalletTx::GetAvailableWatchOnlyCredit()
    2. refactor CWalletTx::GetAvailableCredit()
  2. Use method name from __func__ macro
    Use __func__ macro in std::runtime_exception to:
    1. fix method name in CWalletTx::GetAvailableWatchOnlyCredit()
    2. refactor CWalletTx::GetAvailableCredit()
    9bbf60047e
  3. gmaxwell commented at 1:01 AM on July 5, 2017: contributor

    Other places do this, but it frustrates grepping the source code.

  4. fanquake added the label Wallet on Jul 5, 2017
  5. jonasschnelli commented at 4:21 PM on July 5, 2017: contributor

    If you do so, maybe also tackle the LogPrintf's and get rid of static "CWalletXX::" there?

  6. jnewbery commented at 4:31 PM on July 5, 2017: member

    it frustrates grepping the source code

    At first glance your comment seems reasonable, but is it really a problem? Why not just grep for the function name? Blindly grepping for the complete log string is already going to fail for those log messages that contain C string format specifiers.

  7. laanwj commented at 2:13 PM on July 6, 2017: member

    Using __func__ is preferred because it means one less thing that can be forgotten to be updated when moving the code around to another function. This guarantees that the message will actually have been emitted in the function that is mentioned in the message. As for grepping the message, you could search either the function itself, then locate it manually, or for part of the message that follows the function name. This is already the case as __func__ is used almost everywhere, it's not a discussion worth having IMO.

    utACK https://github.com/bitcoin/bitcoin/pull/10744/commits/9bbf60047ea3300ebaffbe8cdc7c71e984418c20

  8. MarcoFalke commented at 11:13 AM on July 7, 2017: member

    utACK 9bbf60047ea3300ebaffbe8cdc7c71e984418c20

  9. MarcoFalke merged this on Jul 7, 2017
  10. MarcoFalke closed this on Jul 7, 2017

  11. MarcoFalke referenced this in commit ed88e3194c on Jul 7, 2017
  12. PastaPastaPasta referenced this in commit 3e7f709fda on Jul 6, 2019
  13. PastaPastaPasta referenced this in commit 8cbfdfd2cf on Jul 8, 2019
  14. PastaPastaPasta referenced this in commit c29ccc98be on Jul 9, 2019
  15. PastaPastaPasta referenced this in commit c2225dab47 on Jul 11, 2019
  16. PastaPastaPasta referenced this in commit c986e8d04c on Jul 13, 2019
  17. PastaPastaPasta referenced this in commit 99f2b660ba on Jul 17, 2019
  18. PastaPastaPasta referenced this in commit ac10f91574 on Jul 17, 2019
  19. PastaPastaPasta referenced this in commit 7abb60fe63 on Jul 23, 2019
  20. DrahtBot locked this on Sep 8, 2021

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-04-21 15:15 UTC

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