Avoid a compile error on hosts with libevent too old for EVENT_LOG_WARN. #7016

pull gmaxwell wants to merge 1 commits into bitcoin:master from gmaxwell:without_EVENT_LOG_WARN changing 1 files +4 −0
  1. gmaxwell commented at 1:57 PM on November 14, 2015: contributor

    This means that some low priority libevent errors may get logged with debugging disabled when they wouldn't otherwise. In a quick check it did not appear to be chatty.

  2. gmaxwell commented at 1:59 PM on November 14, 2015: contributor

    Not the end of the world if this isn't wanted; it's needed on Fedora 19, and (I think) Fedora 20 which some of my old test hosts are still running and I was tired of patching around it locally. Seems like a mostly harmless compatibility boost.

  3. in src/httpserver.cpp:None in 4e5cb8bab2 outdated
     370 |          LogPrintf("libevent: %s\n", msg);
     371 |      else
     372 |          LogPrint("libevent", "libevent: %s\n", msg);
     373 | +#else
     374 | +    // EVENT_LOG_WARN was added in 2.0.19; so in some older systems libevent warnings won't be debug-only.
     375 | +    LogPrint("libevent: %s\n", msg);
    


    morcos commented at 6:43 PM on November 14, 2015:

    What does LogPrint without a category do? Did you mean this to be LogPrintf?


    gmaxwell commented at 8:38 PM on November 14, 2015:

    Gah. What it doesn't to is it doesn't fail to compile; so much for type safety. Good spotting; thats what I get from changing from the always debug to always no debug at the last second. :-/

  4. petertodd commented at 7:48 PM on November 14, 2015: contributor

    utACK

  5. jonasschnelli added the label RPC on Nov 16, 2015
  6. laanwj commented at 8:54 AM on November 16, 2015: member

    Concept ACK

    Though what I think is interesting here is that we have a severity argument, just not the definition of EVENT_LOG_WARN. Looking at the changelog the old (now deprecated) name for EVENT_LOG_WARN was prefixed with an underscore. Can you try:

    #ifndef EVENT_LOG_WARN
    #define EVENT_LOG_WARN _EVENT_LOG_WARN
    #endif
    

    BTW: If you plan on doing any benchmarking or advanced testing, please use an up to date libevent. There have been various nasty bugs fixed over time.

  7. gmaxwell commented at 9:16 AM on November 16, 2015: contributor

    Indeed, _EVENT_LOG_WARN is there and has the same definition.

  8. Avoid a compile error on hosts with libevent too old for EVENT_LOG_WARN.
    This uses _EVENT_LOG_WARN instead, which appears to be defined in the
     old versions of libevent that I have on some systems.
    aee22bf288
  9. laanwj merged this on Nov 16, 2015
  10. laanwj closed this on Nov 16, 2015

  11. laanwj referenced this in commit dafefb7924 on Nov 16, 2015
  12. zkbot referenced this in commit b0afc4ba1d on Mar 22, 2017
  13. zkbot referenced this in commit f9f48667be on Mar 25, 2017
  14. MarcoFalke 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-13 15:15 UTC

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