test: Handle timestamps without microseconds in combine_logs#13157
Closed
laanwj wants to merge 1 commit intobitcoin:masterfrom
Closed
test: Handle timestamps without microseconds in combine_logs#13157laanwj wants to merge 1 commit intobitcoin:masterfrom
laanwj wants to merge 1 commit intobitcoin:masterfrom
Conversation
The log messages before command line arguments have been parsed will not have microseconds. Make parsing robust to lack of microseconds so that sorting is done correctly, and make their timestamps show as '.000000' to line up the log.
laanwj
commented
May 3, 2018
| yield LogEvent(timestamp=timestamp, source=source, event=event.rstrip()) | ||
| event = line | ||
| timestamp = time_match.group() | ||
| if event or timestamp: |
Member
Author
There was a problem hiding this comment.
Could keep this as if event to not show the (initial) empty log message. That's a matter of taste, I guess.
Member
|
Noting that this is fixed by #13088 |
Member
Author
|
Ok... |
Member
|
This is fixed in
as a side effect of changing the |
maflcko
pushed a commit
that referenced
this pull request
Jun 18, 2019
faa2a47 logging: Add threadsafety comments (MarcoFalke) 0b282f9 Log early messages with -printtoconsole (Anthony Towns) 4129874 Replace OpenDebugLog() with StartLogging() (Anthony Towns) Pull request description: Early log messages are dropped on the floor and they'd never make it to the console or debug log. This can be tested by running the test included in this pull request without re-compiling the `bitcoind`. Fix that by buffering early messages and flushing them as soon as all logging options have been initialized and logging has been started. This pull request is identical to "Log early messages with -printtoconsole" (#13088) by **ajtowns**, with the following changes: * Rebased * Added docstrings for `m_buffering` and `StartLogging` * Switch `CCriticalSection` (aka `RecursiveMutex`) to just `Mutex` in the last commit * Added tests Fixes #16098 Fixes #13157 Closes #13088 ACKs for commit faa2a4: ajtowns: utACK faa2a47 hebasto: ACK faa2a47 kristapsk: ACK faa2a47 (ran added functional test before / after recompiling, didn't do additional testing) Tree-SHA512: 685e2882642fe2a43ce171d42862582dadb840d03cda8236a994322c389ca2a1f3f431b179b2726c155c61793543bb340c568a5455d97f8b83bc7d307a85d387
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
Jun 19, 2019
faa2a47 logging: Add threadsafety comments (MarcoFalke) 0b282f9 Log early messages with -printtoconsole (Anthony Towns) 4129874 Replace OpenDebugLog() with StartLogging() (Anthony Towns) Pull request description: Early log messages are dropped on the floor and they'd never make it to the console or debug log. This can be tested by running the test included in this pull request without re-compiling the `bitcoind`. Fix that by buffering early messages and flushing them as soon as all logging options have been initialized and logging has been started. This pull request is identical to "Log early messages with -printtoconsole" (bitcoin#13088) by **ajtowns**, with the following changes: * Rebased * Added docstrings for `m_buffering` and `StartLogging` * Switch `CCriticalSection` (aka `RecursiveMutex`) to just `Mutex` in the last commit * Added tests Fixes bitcoin#16098 Fixes bitcoin#13157 Closes bitcoin#13088 ACKs for commit faa2a4: ajtowns: utACK faa2a47 hebasto: ACK faa2a47 kristapsk: ACK faa2a47 (ran added functional test before / after recompiling, didn't do additional testing) Tree-SHA512: 685e2882642fe2a43ce171d42862582dadb840d03cda8236a994322c389ca2a1f3f431b179b2726c155c61793543bb340c568a5455d97f8b83bc7d307a85d387
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The log messages before command line arguments have been parsed will not have microseconds. Make parsing robust to lack of microseconds so that sorting is done correctly, and make their timestamps show as '.000000' to line up the log.
Before (note the weird sorting and ordering):
After: