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

Dev Message after log quiescence #9702

Merged
merged 7 commits into from
Aug 31, 2020
Merged

Dev Message after log quiescence #9702

merged 7 commits into from
Aug 31, 2020

Conversation

sgmiller
Copy link
Collaborator

Register a log sink that delays the printing of the big dev warning until logs have settled
down.

@sgmiller sgmiller requested a review from mgritter August 27, 2020 18:37
Copy link
Contributor

@mgritter mgritter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems good.

I'm uncomfortable-ish with changing the type of Logger from an interface to an implementation type. I could suggest ways of working around it, but they would all be sort of weird and artificial.

The other concern I had was whether all the UI output would be interrupted by a log message, which would almost be worse than having it at the top. I don't see any way to tell go-hclog to stop. You might be able to hold things up in quiescenceSink.Accept during the interval where you're printing the message, but that doesn't seem worth it (or necessarily robust, I don't think the delivery order is predictable.)

@sgmiller
Copy link
Collaborator Author

I'm uncomfortable-ish with changing the type of Logger from an interface to an implementation type. I could suggest ways of working around it, but they would all be sort of weird and artificial.

Yeah, didn't love that either, but since that field is only ever an InterceptorLogger it seemed safe and that we could engineer around if we needed to go back to generic Logger.

The other concern I had was whether all the UI output would be interrupted by a log message, which would almost be worse than having it at the top. I don't see any way to tell go-hclog to stop. You might be able to hold things up in quiescenceSink.Accept during the interval where you're printing the message, but that doesn't seem worth it (or necessarily robust, I don't think the delivery order is predictable.)

This I'm sort of okay with. The user experience is still way better than it was where the dev message is buried two pages back. A spurious, differently colored log line interspersed doesn't feel like the end of the world, and would be rare anyway.

@sgmiller sgmiller merged commit 1166bb8 into master Aug 31, 2020
@sgmiller sgmiller deleted the delay-dev-notice branch August 31, 2020 15:45
@mladlow mladlow added this to the 1.6 milestone Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants