Skip to content

feat(cli): Add --log flag for fine-grained log filtering#571

Merged
JeanMertz merged 1 commit intomainfrom
prr138
Apr 16, 2026
Merged

feat(cli): Add --log flag for fine-grained log filtering#571
JeanMertz merged 1 commit intomainfrom
prr138

Conversation

@JeanMertz
Copy link
Copy Markdown
Collaborator

Adds a new --log=DIRECTIVE global flag that accepts a comma-separated list of target=level pairs, forwarded directly to tracing_subscriber::EnvFilter.

This lets users target specific subsystems without flooding output with unrelated noise. For example:

jp query --log=tool::stderr=trace "Hello"
jp query --log='jp_llm=trace,plugin=off' "Hello"

The flag composes with -v: verbosity sets the baseline level for jp's own modules, while --log appends directives that add or override specific targets. Because user-supplied directives are appended last, they take precedence over the baseline.

Passing --log without -v still enables stderr log output. Without this, the flag would silently do nothing unless the user also remembered to pass -v.

Adds a new `--log=DIRECTIVE` global flag that accepts a comma-separated
list of `target=level` pairs, forwarded directly to
`tracing_subscriber::EnvFilter`.

This lets users target specific subsystems without flooding output with
unrelated noise. For example:

    jp query --log=tool::stderr=trace "Hello"
    jp query --log='jp_llm=trace,plugin=off' "Hello"

The flag composes with `-v`: verbosity sets the baseline level for jp's
own modules, while `--log` appends directives that add or override
specific targets. Because user-supplied directives are appended last,
they take precedence over the baseline.

Passing `--log` without `-v` still enables stderr log output. Without
this, the flag would silently do nothing unless the user also remembered
to pass `-v`.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit 63d6e7f into main Apr 16, 2026
13 checks passed
@JeanMertz JeanMertz deleted the prr138 branch April 16, 2026 22:06
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.

1 participant