Skip to content

Changed logging to make -logtimestamps to work also for -printtoconsole#6742

Merged
laanwj merged 1 commit into
bitcoin:masterfrom
arnuschky:feature-logtimestamps-toconsole
Oct 6, 2015
Merged

Changed logging to make -logtimestamps to work also for -printtoconsole#6742
laanwj merged 1 commit into
bitcoin:masterfrom
arnuschky:feature-logtimestamps-toconsole

Conversation

@arnuschky

Copy link
Copy Markdown
Contributor

No reason not to have timestamps on the console, especially as the documentation is unclear about this.

@laanwj

laanwj commented Sep 30, 2015

Copy link
Copy Markdown
Member

Concept ACK

But I think your current implementation has a problem: if a LogPrintf continues on the same line, this will probably add a new timestamp for every print.

@laanwj laanwj added the Docs label Sep 30, 2015
@jgarzik

jgarzik commented Oct 1, 2015

Copy link
Copy Markdown
Contributor

concept ACK - agree w/ problem

@arnuschky

Copy link
Copy Markdown
Contributor Author

Either I am missing your point or you are mistaken. The change I made only caused timestamps to be printed on the console the same way as it is written to the logs.

The current behavior is as follows. Code:

    LogPrintf("multi");
    LogPrintf("call\n");
    LogPrintf("single call\n");
    LogPrintf("multi\nline\n");

Output:

2015-10-01 11:35:38 multicall
2015-10-01 11:35:38 single call
2015-10-01 11:35:38 multi
line

I can't say whether this was the intention of the original author. If a different behavior is desired, I can change it of course.

@laanwj

laanwj commented Oct 1, 2015

Copy link
Copy Markdown
Member

Looks good, then I was mistaken.

@laanwj

laanwj commented Oct 6, 2015

Copy link
Copy Markdown
Member

Tested ack.

@laanwj laanwj merged commit 58981d4 into bitcoin:master Oct 6, 2015
laanwj added a commit that referenced this pull request Oct 6, 2015
58981d4 Changed logging to make -logtimestamps to work also for -printtoconsole (Arne Brutschy)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants