Skip to content

[BUG] cortex logs --paths silently ignores --follow, --level, and --lines instead of rejecting incompatible combinations #52724

@prinws-11

Description

@prinws-11

Project

cortex

Description

The logs command short-circuits into run_paths() before any of the normal log-viewing logic runs. If the user supplies --paths together with viewing flags like --follow, --level, or --lines, Cortex accepts the combination but immediately lists paths and exits, ignoring the other requested viewing behavior.

Error Message

Debug Logs

System Information

OS: Windows 10
RAM: 16 GB
CPU: Intel(R) Core(TM) i7-1165G7 @ 2.8GHz(8 CPUs), ~2.8GH

Screenshots

https://github.com/prinws-11/SN_100_MEDIA_Evidence/blob/main/image18.png

Steps to Reproduce

  1. Run cortex logs --paths --follow --level error -n 5.
  2. Observe the command output and exit behavior.

Expected Behavior

Cortex should reject incompatible flag combinations involving --paths, or clearly document and warn that --paths overrides the normal log-viewing flags.

Actual Behavior

The command accepts the combination, lists log paths, and exits without honoring --follow, --level, or --lines.

Additional Context

src/cortex-cli/src/logs_cmd.rs:

  • run() checks self.paths and immediately returns self.run_paths(&logs_dir).await.
  • That happens before the command selects the most recent log file, before --follow, and before run_show() applies --level and --lines.
    src/cortex-cli/src/logs_cmd.rs:
  • run_paths() only lists files and respects --json; it does not use follow, level, or lines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideIssues related to IDEvalidValid issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions