Print to console by default when not run with -daemon #13004

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:printtoconsole changing 4 files +57 −17
  1. practicalswift commented at 8:03 AM on April 17, 2018: contributor

    Cherry-picked ef6fa1c38e1bd115d1cce155907023d79da379d8 from the "up for grabs" PR: "Smarter default behavior for -printtoconsole" (#12689).

    See previous review in #12689.

  2. Print to console by default when not run with -daemon
    Printing to the debug log file can be disabled with -nodebulogfile
    6a3b0d3d1a
  3. fanquake commented at 8:08 AM on April 17, 2018: member

    @ryanofsky Could you re-review here.

  4. fanquake added the label Utils/log/libs on Apr 17, 2018
  5. practicalswift commented at 8:13 AM on April 17, 2018: contributor

    Previous utACK:ers @MeshCollider and @jnewbery might want to take a look at this one too? :-)

  6. instagibbs commented at 2:04 PM on April 17, 2018: member

    concept ACK

  7. in src/init.cpp:1231 in 6a3b0d3d1a
    1232 | -        // and because this needs to happen before any other debug.log printing
    1233 | -        ShrinkDebugFile();
    1234 | -    }
    1235 | -
    1236 |      if (fPrintToDebugLog) {
    1237 | +        if (gArgs.GetBoolArg("-shrinkdebugfile", logCategories == BCLog::NONE)) {
    


    laanwj commented at 2:56 PM on April 17, 2018:

    Whoa - good catch to move this inside the if (fPrintToDebugLog)

  8. laanwj commented at 3:00 PM on April 17, 2018: member

    Thanks for reviving this, tested ACK 6a3b0d3d1aee1ab924f30b9910bc517c764917cd:

    • src/bitcoind -regtest works as expected, now prints logging output
    • src/bitcoind -regtest -noprinttoconsole successfully silences logging output
    • src/bitcoind -regtest -daemon successfully silences logging output
  9. laanwj merged this on Apr 17, 2018
  10. laanwj closed this on Apr 17, 2018

  11. laanwj referenced this in commit 58bbc55212 on Apr 17, 2018
  12. in test/functional/feature_logging.py:19 in 6a3b0d3d1a
      14 | @@ -15,21 +15,25 @@ def set_test_params(self):
      15 |          self.num_nodes = 1
      16 |          self.setup_clean_chain = True
      17 |  
      18 | +    def relative_log_path(self, name):
      19 | +        return os.path.join(self.nodes[0].datadir, "regtest", name)
    


    MarcoFalke commented at 3:17 PM on April 17, 2018:

    nit: IIRC datadir is absolute, so the relative in the method name is confusing.

  13. in test/functional/feature_logging.py:64 in 6a3b0d3d1a
      58 | @@ -55,6 +59,17 @@ def run_test(self):
      59 |          self.start_node(0, ["-debuglogfile=%s" % (invalidname)])
      60 |          assert os.path.isfile(os.path.join(invdir, "foo.log"))
      61 |  
      62 | +        # check that -nodebuglogfile disables logging
      63 | +        self.stop_node(0)
      64 | +        os.unlink(default_log_path)
    


    MarcoFalke commented at 3:20 PM on April 17, 2018:

    Nit: Could use the identical and more clear "remove", since unlink seems to be some unix specific thing, but we also run the tests on windows.

  14. MarcoFalke commented at 3:21 PM on April 17, 2018: member

    utACK 6a3b0d3d1aee1ab924f30b9910bc517c764917cd. Some naming nits in tests.

  15. in src/init.cpp:829 in 6a3b0d3d1a
     825 |  {
     826 | -    fPrintToConsole = gArgs.GetBoolArg("-printtoconsole", false);
     827 | +    // Add newlines to the logfile to distinguish this execution from the last
     828 | +    // one; called before console logging is set up, so this is only sent to
     829 | +    // debug.log.
     830 | +    LogPrintf("\n\n\n\n\n");
    


    jimpo commented at 5:12 PM on April 17, 2018:

    Hmm, won't it print these newlines even if fPrintToDebugLog ends up being false?

  16. MarcoFalke referenced this in commit bdda14d1c0 on Apr 23, 2018
  17. laanwj referenced this in commit 179f809fda on Apr 25, 2018
  18. laanwj referenced this in commit 3b0e58ecae on Apr 25, 2018
  19. satwo referenced this in commit 5e59bb2502 on Jul 2, 2018
  20. satwo referenced this in commit 749b5864dd on Jul 3, 2018
  21. satwo referenced this in commit 6ac98f8ae4 on Jul 3, 2018
  22. fanquake referenced this in commit 5e362c0cf0 on Jul 8, 2018
  23. laanwj referenced this in commit 17e9106c86 on Jul 9, 2018
  24. marcinja referenced this in commit 1ad77c257f on Jul 10, 2018
  25. satwo referenced this in commit 0de195933b on Jul 10, 2018
  26. satwo referenced this in commit b29a700ebf on Jul 10, 2018
  27. satwo referenced this in commit 84289b29e1 on Jul 11, 2018
  28. satwo referenced this in commit 1a558eba8c on Jul 11, 2018
  29. satwo referenced this in commit 801cb307b5 on Jul 11, 2018
  30. laanwj referenced this in commit 7146672687 on Jul 18, 2018
  31. HashUnlimited referenced this in commit e465bb98a7 on Sep 11, 2018
  32. HashUnlimited referenced this in commit d2e48a4eca on Sep 11, 2018
  33. joemphilips referenced this in commit c589faca8d on Nov 9, 2018
  34. joemphilips referenced this in commit 3a73030a99 on Nov 9, 2018
  35. jfhk referenced this in commit c7fde8f0b2 on Nov 14, 2018
  36. jfhk referenced this in commit a000ec19dc on Nov 14, 2018
  37. PastaPastaPasta referenced this in commit ab41ac7b6e on Jul 17, 2020
  38. PastaPastaPasta referenced this in commit b837837ea6 on Jul 17, 2020
  39. PastaPastaPasta referenced this in commit 2222a9b9f5 on Jul 17, 2020
  40. PastaPastaPasta referenced this in commit ce7b983ca4 on Nov 10, 2020
  41. PastaPastaPasta referenced this in commit d33911769b on Nov 12, 2020
  42. PastaPastaPasta referenced this in commit 4d10091cc8 on Nov 17, 2020
  43. practicalswift deleted the branch on Apr 10, 2021
  44. PastaPastaPasta referenced this in commit 6b9a091c16 on Apr 13, 2021
  45. xdustinface referenced this in commit e444783519 on Apr 14, 2021
  46. PastaPastaPasta referenced this in commit 4515d720ab on Apr 14, 2021
  47. PastaPastaPasta referenced this in commit dab2e0bb84 on Apr 14, 2021
  48. PastaPastaPasta referenced this in commit 4726423359 on Apr 15, 2021
  49. PastaPastaPasta referenced this in commit 1ac7421571 on Apr 15, 2021
  50. PastaPastaPasta referenced this in commit 624ba4d18e on Apr 15, 2021
  51. PastaPastaPasta referenced this in commit 5d24bff413 on Apr 17, 2021
  52. PastaPastaPasta referenced this in commit 90bc40d297 on Apr 18, 2021
  53. kittywhiskers referenced this in commit 0f59ed213b on Apr 23, 2021
  54. gades referenced this in commit c84e010a32 on Mar 10, 2022
  55. gades referenced this in commit b0b40dadb7 on Mar 11, 2022
  56. gades referenced this in commit 07e67f4603 on Apr 21, 2022
  57. DrahtBot locked this on Aug 16, 2022

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