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

fix: Support all logger level case variants #4242

Merged

Conversation

JonathanWoollett-Light
Copy link
Contributor

@JonathanWoollett-Light JonathanWoollett-Light commented Nov 15, 2023

Changes

This commit re-introduces this support such that all variants should again be supported.

Reason

#4047 updated
parsing the logger level filter. It removed all case variants outside
fully uppercase (e.g. INFO) and the 1st character being upper case
(e.g. Info) this removed support for other previously supported
variants e.g. info.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following
Developer Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • [ ] Any required documentation changes (code and docs) are included in this PR.
  • [ ] API changes follow the Runbook for Firecracker API changes.
  • [ ] User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • [ ] New TODOs link to an issue.
  • Commits meet contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@JonathanWoollett-Light JonathanWoollett-Light marked this pull request as draft November 15, 2023 10:05
@JonathanWoollett-Light JonathanWoollett-Light changed the title fix: Support all upper-lower logger level case variants fix: Support all logger level case variants Nov 15, 2023
@JonathanWoollett-Light JonathanWoollett-Light force-pushed the logger-level-string branch 2 times, most recently from 3aeda6c to a208275 Compare November 15, 2023 10:43
Copy link

codecov bot commented Nov 23, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (da92bf6) 81.66% compared to head (08ae0d9) 81.66%.

Files Patch % Lines
src/vmm/src/logger/logging.rs 95.65% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4242   +/-   ##
=======================================
  Coverage   81.66%   81.66%           
=======================================
  Files         240      240           
  Lines       29288    29303   +15     
=======================================
+ Hits        23917    23931   +14     
- Misses       5371     5372    +1     
Flag Coverage Δ
4.14-c7g.metal 77.11% <95.65%> (+<0.01%) ⬆️
4.14-m5d.metal 79.01% <95.65%> (+<0.01%) ⬆️
4.14-m6a.metal 78.12% <95.65%> (+<0.01%) ⬆️
4.14-m6g.metal 77.11% <95.65%> (+<0.01%) ⬆️
4.14-m6i.metal 78.99% <95.65%> (+<0.01%) ⬆️
5.10-c7g.metal 79.99% <95.65%> (+<0.01%) ⬆️
5.10-m5d.metal 81.66% <95.65%> (+<0.01%) ⬆️
5.10-m6a.metal 80.87% <95.65%> (+<0.01%) ⬆️
5.10-m6g.metal 79.99% <95.65%> (+<0.01%) ⬆️
5.10-m6i.metal 81.64% <95.65%> (+<0.01%) ⬆️
6.1-c7g.metal 79.99% <95.65%> (+<0.01%) ⬆️
6.1-m5d.metal 81.66% <95.65%> (+<0.01%) ⬆️
6.1-m6a.metal 80.87% <95.65%> (+<0.01%) ⬆️
6.1-m6g.metal 79.99% <95.65%> (+<0.01%) ⬆️
6.1-m6i.metal 81.64% <95.65%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wearyzen wearyzen force-pushed the logger-level-string branch 3 times, most recently from a83930f to 9e7af0a Compare November 24, 2023 00:14
@wearyzen wearyzen marked this pull request as ready for review November 24, 2023 00:15
@wearyzen wearyzen force-pushed the logger-level-string branch 7 times, most recently from feb4256 to 68f56ff Compare November 24, 2023 02:08
@wearyzen wearyzen added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Nov 24, 2023
src/vmm/src/logger/logging.rs Outdated Show resolved Hide resolved
src/vmm/src/logger/logging.rs Outdated Show resolved Hide resolved
src/vmm/src/logger/logging.rs Outdated Show resolved Hide resolved
src/vmm/src/logger/logging.rs Show resolved Hide resolved
src/vmm/src/logger/logging.rs Show resolved Hide resolved
src/vmm/src/logger/logging.rs Outdated Show resolved Hide resolved
@wearyzen wearyzen force-pushed the logger-level-string branch 2 times, most recently from 3ccead7 to 31b1a03 Compare November 24, 2023 10:12
src/vmm/src/logger/logging.rs Outdated Show resolved Hide resolved
src/vmm/src/logger/logging.rs Outdated Show resolved Hide resolved
@wearyzen wearyzen force-pushed the logger-level-string branch 4 times, most recently from 012138a to 0fb909c Compare November 24, 2023 11:29
roypat
roypat previously approved these changes Nov 24, 2023
Jonathan Woollett-Light and others added 2 commits November 24, 2023 13:15
firecracker-microvm#4047 updated
parsing the logger level filter. It removed all case variants outside
fully uppercase (e.g. `INFO`) and the 1st character being upper case
(e.g. `Info`) this removed support for other previously supported
variants e.g. `info`. This commit re-introduces this support such that
all variants should again be supported.
Fixes commit 332f218

Signed-off-by: Jonathan Woollett-Light <jcawl@amazon.co.uk>
Signed-off-by: Sudan Landge <sudanl@amazon.com>
Add unit test to cover all cases of LevelFilter.
Remove redundant logic from levelfilter_from_str because
levelfilter_from_str_all_variants is a better place to put the logic.

Signed-off-by: Jonathan Woollett-Light <jcawl@amazon.co.uk>
Signed-off-by: Sudan Landge <sudanl@amazon.com>
@wearyzen wearyzen merged commit 640b6d6 into firecracker-microvm:main Nov 24, 2023
6 of 7 checks passed
roypat added a commit to roypat/firecracker that referenced this pull request Nov 24, 2023
It was forgotten about in that PR.

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
roypat added a commit to roypat/firecracker that referenced this pull request Nov 24, 2023
It was forgotten about in that PR.

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
roypat added a commit to roypat/firecracker that referenced this pull request Nov 24, 2023
It was forgotten about in that PR.

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
wearyzen pushed a commit that referenced this pull request Nov 27, 2023
Adding an entry for #4270 which is a backport of #4242.

Signed-off-by: Sudan Landge <sudanl@amazon.com>
wearyzen pushed a commit to roypat/firecracker that referenced this pull request Nov 27, 2023
It was forgotten about in that PR.

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
roypat added a commit that referenced this pull request Nov 27, 2023
It was forgotten about in that PR.

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
roypat added a commit to roypat/firecracker that referenced this pull request Nov 27, 2023
It was forgotten about in that PR.

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting review Indicates that a pull request is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants