Log early messages with -printtoconsole #13088

pull ajtowns wants to merge 3 commits into bitcoin:master from ajtowns:earlyconsolelog changing 4 files +53 −39
  1. ajtowns commented at 12:12 PM on April 26, 2018: contributor

    This allows any log messages sent prior to the -printtoconsole option being parsed to be replayed onto the console. This could be handy if option parsing (parameters/config file) wants to output any warnings or info messages.

  2. fanquake added the label Utils/log/libs on Apr 26, 2018
  3. ajtowns cross-referenced this on Apr 26, 2018 from issue New -includeconf argument for including external configuration files by kallewoof
  4. promag commented at 10:36 AM on April 29, 2018: member

    Concept ACK.

  5. ajtowns force-pushed on May 3, 2018
  6. ajtowns commented at 2:09 PM on May 3, 2018: contributor

    Rebased on top of 12954 and 13148. Nitpicking welcome.

  7. MarcoFalke commented at 2:56 PM on May 3, 2018: member

    Is this of any relevance? I had the impression that parameter interaction was done after logging was set up.

  8. MarcoFalke added the label Refactoring on May 3, 2018
  9. MarcoFalke cross-referenced this on May 3, 2018 from issue test: Handle timestamps without microseconds in combine_logs by laanwj
  10. MarcoFalke commented at 3:30 PM on May 3, 2018: member

    Noting that replacing the LogPrintf with FileWriteStr fixes #13157

  11. DrahtBot cross-referenced this on Jun 14, 2018 from issue [bugfix] Fix encoding issue for Windows by ken2812221
  12. DrahtBot commented at 11:49 PM on July 22, 2018: contributor

    <!--5d09a71f8925f3f132321140b44b946d-->The last travis run for this pull request was 80 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened.

  13. DrahtBot closed this on Jul 22, 2018

  14. DrahtBot reopened this on Jul 22, 2018

  15. DrahtBot cross-referenced this on Jul 25, 2018 from issue [WIP] Full unicode support on Windows by ken2812221
  16. DrahtBot cross-referenced this on Jul 28, 2018 from issue Test for Windows encoding issue by ken2812221
  17. sipa cross-referenced this on Jul 30, 2018 from issue Ignore unknown config file options; warn instead of error by sipa
  18. MarcoFalke added the label Up for grabs on Jul 31, 2018
  19. DrahtBot cross-referenced this on Aug 1, 2018 from issue Include tinyformat as a subtree by Empact
  20. DrahtBot cross-referenced this on Aug 2, 2018 from issue Include tinyformat as a subtree by Empact
  21. DrahtBot cross-referenced this on Aug 2, 2018 from issue Move src/tinyformat.h to src/tinyformat/tinyformat.h by Empact
  22. ajtowns force-pushed on Aug 7, 2018
  23. ajtowns force-pushed on Aug 7, 2018
  24. ajtowns force-pushed on Aug 7, 2018
  25. ajtowns commented at 8:03 AM on August 7, 2018: contributor

    Rebased, dropped overlapping commit with #13159 (which probably should be merged first), and note that CCriticalSection change introduces dependency loop.

  26. DrahtBot cross-referenced this on Aug 10, 2018 from issue use a pretty ascii art to distinguish executions in debug.log by scravy
  27. DrahtBot cross-referenced this on Aug 11, 2018 from issue refactor: Removal of circular dependency between index/txindex, validation and index/base by mgrychow
  28. DrahtBot cross-referenced this on Aug 23, 2018 from issue Utxoscriptindex by mgrychow
  29. DrahtBot added the label Needs rebase on Aug 31, 2018
  30. Replace OpenDebugLog() with StartLogging()
    StartLogging() is used to mark the start of logging generically, whether
    using -printtoconsole or -debuglogfile.
    4348366585
  31. Log early messages with -printtoconsole
    This ensures log messages prior to StartLogging() are replayed to
    the console as well as to the debug log file.
    bf6c20da4c
  32. logging.cpp: use CCriticalSection instead of std::mutex
    Note: this introduces a circular dependency between logging and sync,
    since sync does logging, and logging does synchronisation.
    383e923372
  33. ajtowns force-pushed on Sep 3, 2018
  34. DrahtBot removed the label Needs rebase on Sep 3, 2018
  35. DrahtBot cross-referenced this on Sep 7, 2018 from issue Process logs in a separate thread by jamesob
  36. DrahtBot cross-referenced this on Sep 8, 2018 from issue add -debuglogsize=<n> option by SuckShit
  37. MarcoFalke removed the label Up for grabs on Sep 8, 2018
  38. MarcoFalke commented at 9:23 PM on September 9, 2018: member

    The tests seem to fail or deadlock

  39. DrahtBot commented at 10:38 PM on September 20, 2018: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #15329 (Fix InitError() and InitWarning() content by hebasto)
    • #15266 (memory: Construct globals on first use by MarcoFalke)
    • #14169 (add -debuglogsize=<n> option by SuckShit)
    • #13949 (Introduce MempoolObserver interface to break "policy/fees -> txmempool -> policy/fees" circular dependency by Empact)
    • #10443 (Add fee_est tool for debugging fee estimation code 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.

  40. DrahtBot cross-referenced this on Sep 21, 2018 from issue Add fee_est tool for debugging fee estimation code by ryanofsky
  41. in test/lint/lint-circular-dependencies.sh:15 in 383e923372
      11 | @@ -12,6 +12,7 @@ EXPECTED_CIRCULAR_DEPENDENCIES=(
      12 |      "chainparamsbase -> util -> chainparamsbase"
      13 |      "checkpoints -> validation -> checkpoints"
      14 |      "index/txindex -> validation -> index/txindex"
      15 | +    "logging -> sync -> logging"
    


    practicalswift commented at 5:51 PM on October 10, 2018:

    What would be required to avoid introducing this circular dependency? :-)

  42. in src/logging.h:64 in 383e923372
      60 | @@ -59,9 +61,10 @@ namespace BCLog {
      61 |      class Logger
      62 |      {
      63 |      private:
      64 | -        FILE* m_fileout = nullptr;
      65 | -        std::mutex m_file_mutex;
      66 | -        std::list<std::string> m_msgs_before_open;
      67 | +        CCriticalSection m_cs_log;
    


    MarcoFalke commented at 7:58 PM on January 16, 2019:

    nit:

            RecursiveMutex m_cs_log;
    
  43. MarcoFalke commented at 7:58 PM on January 16, 2019: member

    Needs rebase to have travis run again

  44. DrahtBot commented at 7:42 PM on February 4, 2019: contributor

    <!--cf906140f33d8803c4a75a2196329ecb-->Needs rebase

  45. DrahtBot added the label Needs rebase on Feb 4, 2019
  46. MarcoFalke cross-referenced this on May 28, 2019 from issue util: Log early messages by MarcoFalke
  47. ajtowns commented at 3:38 AM on May 29, 2019: contributor

    Closing in favour of #16112

  48. ajtowns closed this on May 29, 2019

  49. MarcoFalke referenced this in commit 0853d8d2fd on Jun 18, 2019
  50. sidhujag referenced this in commit 6347640464 on Jun 19, 2019
  51. laanwj removed the label Needs rebase on Oct 24, 2019
  52. bitcoin locked this on Dec 16, 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-05-19 06:54 UTC