[trivial] Add newlines to end of log messages. #12887

pull jnewbery wants to merge 1 commits into bitcoin:master from jnewbery:log_messages_newlines changing 2 files +2 −2
  1. jnewbery commented at 7:54 pm on April 4, 2018: member
    Log messages should terminate with a ‘\n’, or the following log will be written to the same line without a timestamp. Fix a couple of cases where the message is not terminated with a \n.
  2. [trivial] Add newlines to end of log messages.
    Log messages should terminate with a '\n', or the following log will be
    written to the same line without a timestamp. Fix a couple of cases
    where the message is not terminated with a \n.
    5b10ab0116
  3. jamesob commented at 8:18 pm on April 4, 2018: member

    utACK https://github.com/bitcoin/bitcoin/pull/12887/commits/5b10ab0116245ee73b493e2248ad2f8bb8e34f21

    Worth fixing this more generally in LogPrintf later on?

  4. MarcoFalke commented at 8:19 pm on April 4, 2018: member
    Mind to add a linter for this, since we have those issues every couple of months?
  5. jnewbery commented at 8:25 pm on April 4, 2018: member

    Mind to add a linter for this, since we have those issues every couple of months?

    There are legitimate uses for this, for example to build up a log message from multiple parts:

    https://github.com/bitcoin/bitcoin/blob/1d540046fe47eb7b6062c55ebebd801ece96231c/src/sync.cpp#L83

    and

    https://github.com/bitcoin/bitcoin/blob/1d540046fe47eb7b6062c55ebebd801ece96231c/src/txdb.cpp#L373

    (I suppose those could be changed to build a string, which is then passed to LogPrintf())

  6. fanquake added the label Utils/log/libs on Apr 4, 2018
  7. Empact commented at 0:48 am on April 5, 2018: member
    utACK 5b10ab0
  8. MarcoFalke commented at 0:53 am on April 5, 2018: member
    utACK 5b10ab0
  9. fanquake commented at 1:05 am on April 5, 2018: member
    utACK 5b10ab0
  10. laanwj merged this on Apr 5, 2018
  11. laanwj closed this on Apr 5, 2018

  12. laanwj referenced this in commit 2fc94370f5 on Apr 5, 2018
  13. laanwj commented at 7:14 am on April 5, 2018: member

    There are legitimate uses for this, for example to build up a log message from multiple parts:

    Could have the linter check for a specific comment /* Continued */ or such.

    (I suppose those could be changed to build a string, which is then passed to LogPrintf())

    That would defeat the intent, to log partial lines to show progress.

  14. jnewbery commented at 1:31 pm on April 5, 2018: member

    Could have the linter check for a specific comment /* Continued */ or such

    Yes, good idea. Longer term, it could be good to have a LogPrintf() and a LogPrintfContinuation(), and remove all \ns from the log strings. LogPrintf() would then prefix the log string with a newline followed by the timestamp. LogPrintfContinuation() would just print the log string.

    That would defeat the intent, to log partial lines to show progress.

    Yes, good point

  15. jnewbery deleted the branch on Apr 5, 2018
  16. MarcoFalke referenced this in commit 9d67d8d07f on Apr 20, 2018
  17. MarcoFalke referenced this in commit 858788f4d6 on May 24, 2018
  18. MarcoFalke referenced this in commit 71d0a99457 on May 24, 2018
  19. MarcoFalke referenced this in commit ec1d30e6c0 on May 29, 2018
  20. MarcoFalke referenced this in commit 2291774bd5 on Jul 12, 2018
  21. HashUnlimited referenced this in commit 1d53e22f22 on Jan 11, 2019
  22. 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: 2024-10-04 22:12 UTC

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