Skip to content

fix(logs): validate level filter values#334

Open
OnlyYu1996 wants to merge 1 commit into
CortexLM:mainfrom
OnlyYu1996:fix-logs-level-validation
Open

fix(logs): validate level filter values#334
OnlyYu1996 wants to merge 1 commit into
CortexLM:mainfrom
OnlyYu1996:fix-logs-level-validation

Conversation

@OnlyYu1996
Copy link
Copy Markdown

Fixes PlatformNetwork/bounty-challenge#53518.

Summary

  • Make cortex logs --level a validated clap value instead of accepting arbitrary strings.
  • Filter log output by parsed severity tokens rather than raw message substring matches.
  • Add regression coverage for invalid level rejection, the warning alias, structured level matching, and message-substring false positives.

Validation

  • cargo +1.90.0 fmt --package cortex-cli --check
  • git diff --check

Targeted cargo +1.90.0 test -p cortex-cli test_logs_cli_level_filter -- --nocapture is blocked in this Windows/MSVC environment before crate tests run by the existing aws-lc-sys C build failure.

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

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.

[BUG] [v0.0.7] cortex logs --level accepts arbitrary strings and matches log content instead of validating log levels

1 participant