Skip to content

Adding MultiBar logging  #51

@bbugh

Description

@bbugh

Hi! 👋 Firstly, THANK YOU FOR THESE AMAZING GEMS! The TTY suite is exceptional.

Describe the problem

When using TTY::ProgressBar::Multi, logging with each registered bar results in corrupted output.

Steps to reproduce the problem

multi_bar = TTY::ProgressBar::Multi.new("Example [:bar] :percent", total: examples.count)

bars = [
    multi_bar.register("Thread 1 [:bar] :percent", total: examples.count / 4),
    multi_bar.register("Thread 2 [:bar] :percent", total: examples.count / 4),
    multi_bar.register("Thread 3 [:bar] :percent", total: examples.count / 4),
    multi_bar.register("Thread 4 [:bar] :percent", total: examples.count / 4)
]

Parallel.each(examples) do 
    bars[Parallel.worker_number].log "Something"
end

Actual behaviour

The previous logs are overwritten:

├── Thread 6 [= ] 50%ff@email.com' (1912) updated
├── Thread 7 [= ] 50%on@email.com' (1911) updated
├── Thread 4 [= ] 50%tacos@gmail.com' (1913) updated
├── Thread 5 [= ] 50%super.com' (1915) updated
├── Thread 0 [= ] 50%ar@wow.com' (1608) updated
├── Thread 3 [= ] 50%oldgreg@nothing.com' (1874) updateded

Expected behaviour

Logging is printed above the multibar

Describe your environment

  • OS version: Mac OS Mojave
  • Ruby version: 2.6.6 something
  • TTY::ProgressBar version: 0.18.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions