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

Handle nested progress bars #13

Merged
merged 11 commits into from
Feb 27, 2020
Merged

Handle nested progress bars #13

merged 11 commits into from
Feb 27, 2020

Conversation

tkf
Copy link
Collaborator

@tkf tkf commented Jan 27, 2020

This is an implementation of nested progress handling specified by RFC JuliaLogging/ProgressLogging.jl#13.

It's ready for review but I'm submitting it as a draft since it requires ProgressLogging.jl with JuliaLogging/ProgressLogging.jl#13 to be released.

Peek 2020-01-26 19-04

@c42f
Copy link
Member

c42f commented Jan 30, 2020

This certainly looks promising to me 👍

@tkf tkf changed the title RFC: Handle nested progress bars Handle nested progress bars Feb 17, 2020
@tkf tkf marked this pull request as ready for review February 17, 2020 08:09
@c42f
Copy link
Member

c42f commented Feb 21, 2020

This looks pretty good to me at a quick browse.

I wondered if there should have a couple of extra tests here covering how the nesting is printed?

@@ -95,7 +95,7 @@ end

function Base.push!(sticky::StickyMessages, message::Pair)
if !sticky.ansi_codes
write(sticky.io, message[2])
println(sticky.io, rstrip(message[2]))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tweaked how StickyMessages is handled in unsupported TTYs a bit. I think we need to ensure printing newline to be a bit more consistent with how it is handled in supported TTYs. Otherwise, multi-line sticky messages like nested progress bars are unreadable in such output streams. I wondered if I should use chomp here but I guessed it might be better to print only one newline to be as compact as possible.

@tkf
Copy link
Collaborator Author

tkf commented Feb 27, 2020

OK, I added some tests for nested progress bars. Anything else you want to address here?

("", (progress = "done", _id = 2222)), # 8
("Outer", (progress = 0.4, _id = 1111)),
("", (progress = "done", _id = 1111)),
]; width=60)
Copy link
Member

Choose a reason for hiding this comment

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

Just wondering whether you cover the case of inner progress with parent id's somewhere here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ooooh, thanks a lot for noticing this. I totally forgot how it works 🤣. I added proper tests for nested progress bars now.

Copy link
Member

Choose a reason for hiding this comment

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

Looks good!

Copy link
Member

@c42f c42f left a comment

Choose a reason for hiding this comment

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

Looks good to me, do feel free to merge it when you're ready (one small thing; I wondered whether you covered the indentation of progress bars with parents in the tests?)

@tkf tkf merged commit b87cf48 into JuliaLogging:master Feb 27, 2020
@tkf
Copy link
Collaborator Author

tkf commented Feb 27, 2020

Thanks for the review! Do you think it's ready for another release?

@tkf tkf deleted the nested-progress branch February 27, 2020 07:40
@c42f
Copy link
Member

c42f commented Feb 28, 2020

Sure, this is useful so if you want to release feel free. The prospect of a release has inspired me to finish the markdown hacking in #23 so we could try getting that in as well.

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.

2 participants