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

Output redirection & status monitor #207

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jkellerer
Copy link
Collaborator

Work in progress:

  • Implement Add 'stdout-command' to 'dump' command #153 for all commands (provide clean stdout redirection)
  • Auto enable "extended-status" if required or warn if status/prom feature is non-functional
  • Provide a console monitor (when "extended-status" output is enabled)
  • Update restic output parsers to cover current versions
  • Eval if prune, check, forget can be covered in output parsing

Also moved reusable utils to utils package
@jkellerer jkellerer force-pushed the ft-redirect-output branch from b0e1f4d to e5647fc Compare May 1, 2023 14:33
@jkellerer jkellerer changed the title Ft redirect output Output redirection & status monitor May 1, 2023
Also adds a status monitor when run in console mode
@jkellerer jkellerer force-pushed the ft-redirect-output branch from e5647fc to 117f6f8 Compare May 1, 2023 15:38
@codecov
Copy link

codecov bot commented May 1, 2023

Codecov Report

Patch coverage: 42.56% and project coverage change: -4.03 ⚠️

Comparison is base (0c7405f) 76.65% compared to head (117f6f8) 72.62%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
- Coverage   76.65%   72.62%   -4.03%     
==========================================
  Files          88      104      +16     
  Lines        9482    10706    +1224     
==========================================
+ Hits         7268     7775     +507     
- Misses       1968     2649     +681     
- Partials      246      282      +36     
Impacted Files Coverage Δ
util/filewriter.go 0.00% <0.00%> (ø)
util/reader.go 0.00% <0.00%> (ø)
util/writer.go 0.00% <0.00%> (ø)
wrapper_stdout.go 0.00% <0.00%> (ø)
commands_display.go 24.90% <16.67%> (-14.79%) ⬇️
monitor/console/progress.go 21.38% <21.38%> (ø)
shell/analyser.go 90.00% <36.36%> (-5.08%) ⬇️
wrapper.go 83.48% <41.67%> (-0.51%) ⬇️
util/ansi/colors.go 44.44% <44.44%> (ø)
term/term.go 50.19% <49.50%> (+13.08%) ⬆️
... and 15 more

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@creativeprojects
Copy link
Owner

Provide a console monitor (when "extended-status" output is enabled)

I've been thinking about doing that for quite some time as well 😉

@jkellerer
Copy link
Collaborator Author

jkellerer commented May 1, 2023

Sorry didn't wan't to take it away, but it just fit too well into rethinking output handling.
While the status monitor already works quite well, the output needs to be improved.

@creativeprojects
Copy link
Owner

Sorry didn't wan't to take it away, but it just fit too well into rethinking output handling.
While the status monitor already works quite well, the output needs to be improved.

No problem 👍🏻
FYI I was thinking either copying the restic code used to display the progress, or go wild with a library like https://github.com/pterm/pterm

@jkellerer
Copy link
Collaborator Author

... I was thinking I'd like to learn how it can be achieved, so I created it mostly from scratch. No external deps but maybe less smart.

256 colors could be supported and there's also an option to read the background on xterm to decide on the theme. Eventually this can be useful but for the moment I try to limit the amount of colors that are used. In the end it shouldn't be annoying.

@creativeprojects
Copy link
Owner

256 colors could be supported and there's also an option to read the background on xterm to decide on the theme. Eventually this can be useful but for the moment I try to limit the amount of colors that are used. In the end it shouldn't be annoying.

I agree. Too many colours is complicated to get right on both a light and dark background anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants