fix(analyze): respect --log-level in output and JSON#194
fix(analyze): respect --log-level in output and JSON#194
--log-level in output and JSON#194Conversation
commit: |
--log-level in output and JSON
| description: | ||
| 'Output results as JSON to stdout (messages respect --log-level unless --json-full)' | ||
| }, | ||
| 'json-full': { |
There was a problem hiding this comment.
why do we need this? would we not just set the right log level?
There was a problem hiding this comment.
so this is my reasoning, --log-level ties together 2 things: what counts for the exit code and (by def now) what goes in messages. those aren't always the same want --json-full splits them for JSON consumers so you can keep a strict exit policy without throwing away diagnostics. we need it when consumers want the full messages payload but --log-level should only gate CI exit; raising log level to get more messages also changes when we exit non-zero, so this flag decouples those for --json.
There was a problem hiding this comment.
i understand now. im not a fan of json-full though 😅
e.g. ESLint has --quiet which means "only output errors"
so maybe we need --output-level or --report-level or something...
this wires
--log-levelthrough to what you actually see: pretty analyze output and the messages array in--jsonnow only include severities at or above the chosen level, so stuff like--log-levelerror finally hides warnings/suggestions instead of feeling broken. If you still want the full diagnostic list in JSON but need a stricter exit code, there’s--json-fullfor that. Unknown message severities are treated like warnings so nothing silently disappears.closes: #192