Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 6, 2015

Conversation

arnuschky
Copy link
Contributor

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

@laanwj
Copy link
Member

laanwj commented Sep 30, 2015

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
Copy link
Contributor

jgarzik commented Oct 1, 2015

concept ACK - agree w/ problem

@arnuschky
Copy link
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
Copy link
Member

laanwj commented Oct 1, 2015

Looks good, then I was mistaken.

@laanwj
Copy link
Member

laanwj commented Oct 6, 2015

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