[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-
jnewbery commented at 7:54 pm on April 4, 2018: memberLog 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.
-
[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.
-
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? -
MarcoFalke commented at 8:19 pm on April 4, 2018: memberMind to add a linter for this, since we have those issues every couple of months?
-
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()
) -
fanquake added the label Utils/log/libs on Apr 4, 2018
-
Empact commented at 0:48 am on April 5, 2018: memberutACK 5b10ab0
-
MarcoFalke commented at 0:53 am on April 5, 2018: memberutACK 5b10ab0
-
fanquake commented at 1:05 am on April 5, 2018: memberutACK 5b10ab0
-
laanwj merged this on Apr 5, 2018
-
laanwj closed this on Apr 5, 2018
-
laanwj referenced this in commit 2fc94370f5 on Apr 5, 2018
-
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.
-
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 aLogPrintfContinuation()
, and remove all\n
s 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
-
jnewbery deleted the branch on Apr 5, 2018
-
MarcoFalke referenced this in commit 9d67d8d07f on Apr 20, 2018
-
MarcoFalke referenced this in commit 858788f4d6 on May 24, 2018
-
MarcoFalke referenced this in commit 71d0a99457 on May 24, 2018
-
MarcoFalke referenced this in commit ec1d30e6c0 on May 29, 2018
-
MarcoFalke referenced this in commit 2291774bd5 on Jul 12, 2018
-
HashUnlimited referenced this in commit 1d53e22f22 on Jan 11, 2019
-
MarcoFalke locked this on Sep 8, 2021
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-12-18 15:12 UTC
More mirrored repositories can be found on mirror.b10c.me