Project
cortex
Description
The cortex logs --level option is expected to filter logs by predefined severity levels (e.g., error, warn, info). However, the command accepts arbitrary string values and appears to match them against the raw log line text instead of validating them as structured log levels.
For example, passing a non-standard value like rr still returns results because it matches substrings within log messages (e.g., [ERROR]), rather than being rejected as an invalid level.
This behavior is inconsistent with typical CLI expectations where enumerated flags should only accept defined values.
Error Message
Debug Logs
System Information
OS: Windows 11
Cortex CLI version: v0.0.7
Screenshots
https://github.com/springoliver/bounty_challenge_report_image/blob/main/49117.mp4
Steps to Reproduce
- Open terminal with cortex installed
- Run:
cortex logs --level error
→ Observe normal filtered output
- Run:
cortex logs --level rr
- Compare results
Expected Behavior
- --level should accept only valid log levels (e.g., error, warn, info)
- Invalid values should return an error or validation message
Actual Behavior
- Arbitrary strings are accepted
- Filtering is applied using substring matching on log lines
- Invalid values produce misleading results
Additional Context
The current behavior suggests that the filter is applied as a raw string match rather than a structured level comparison, which can lead to unintended matches and incorrect debugging conclusions.
Project
cortex
Description
The cortex logs --level option is expected to filter logs by predefined severity levels (e.g., error, warn, info). However, the command accepts arbitrary string values and appears to match them against the raw log line text instead of validating them as structured log levels.
For example, passing a non-standard value like rr still returns results because it matches substrings within log messages (e.g., [ERROR]), rather than being rejected as an invalid level.
This behavior is inconsistent with typical CLI expectations where enumerated flags should only accept defined values.
Error Message
Debug Logs
System Information
Screenshots
https://github.com/springoliver/bounty_challenge_report_image/blob/main/49117.mp4
Steps to Reproduce
cortex logs --level error
→ Observe normal filtered output
cortex logs --level rr
Expected Behavior
Actual Behavior
Additional Context
The current behavior suggests that the filter is applied as a raw string match rather than a structured level comparison, which can lead to unintended matches and incorrect debugging conclusions.