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

Merged
merged 1 commit into from Oct 6, 2015

Conversation

Projects
None yet
3 participants
@arnuschky
Contributor

arnuschky commented Sep 30, 2015

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

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Sep 30, 2015

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.

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

This comment has been minimized.

Show comment
Hide comment
@jgarzik

jgarzik Oct 1, 2015

Contributor

concept ACK - agree w/ problem

Contributor

jgarzik commented Oct 1, 2015

concept ACK - agree w/ problem

@arnuschky

This comment has been minimized.

Show comment
Hide comment
@arnuschky

arnuschky Oct 1, 2015

Contributor

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.

Contributor

arnuschky commented Oct 1, 2015

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

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Oct 1, 2015

Member

Looks good, then I was mistaken.

Member

laanwj commented Oct 1, 2015

Looks good, then I was mistaken.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Oct 6, 2015

Member

Tested ack.

Member

laanwj commented Oct 6, 2015

Tested ack.

@laanwj laanwj merged commit 58981d4 into bitcoin:master Oct 6, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Oct 6, 2015

Merge pull request #6742
58981d4 Changed logging to make -logtimestamps to work also for -printtoconsole (Arne Brutschy)

@dagurval dagurval referenced this pull request in bitcoinxt/bitcoinxt Apr 23, 2017

Merged

Util ports #197

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment