-
Notifications
You must be signed in to change notification settings - Fork 37.8k
test: Handle timestamps without microseconds in combine_logs #13157
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
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.
yield LogEvent(timestamp=timestamp, source=source, event=event.rstrip()) | ||
event = line | ||
timestamp = time_match.group() | ||
if event or timestamp: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could keep this as if event
to not show the (initial) empty log message. That's a matter of taste, I guess.
Noting that this is fixed by #13088 |
Ok... |
This is fixed in
as a side effect of changing the |
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
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
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: