rich
rich copied to clipboard
Add the `log_omit_repeated_times` option to `Console`
Type of changes
- [ ] Bug fix
- [x] New feature
- [ ] Documentation / docstrings
- [ ] Tests
- [ ] Other
Checklist
- [x] I've run the latest black with default args on new code.
- [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
- [ ] I've added tests for new code.
- [x] I accept that @willmcgugan may be pedantic in the code review.
Description
This PR adds a log_omit_repeated_times option to the Console constructor. When set to False, the omission of repeated times by log() methods is disabled.
Hey @willmcgugan. Is this a feature that could be considered? If so, do I need to add anything to the PR?
Codecov Report
Merging #2013 (4eb6aff) into master (75f4637) will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #2013 +/- ##
=======================================
Coverage 99.81% 99.81%
=======================================
Files 71 71
Lines 7058 7058
=======================================
Hits 7045 7045
Misses 13 13
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 99.81% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| rich/console.py | 100.00% <ø> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update aa4546a...4eb6aff. Read the comment docs.
The constructor already has a large argument list. I'd prefer not to add to it without good reason.
What is your use case? Why do you not want identical times removed from the log function?
In my case, I wanted to be able to grep a log and be able to check the time it was recorded. But my motivation to write this PR was just because it made sense to me to have feature parity.
This option makes sense for logging, but less so for Console.log. Not worth adding yet another option. Thanks for the contribution.