-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Logging should be done to STDERR by default. STDOUT should be reserved for scriptable output. #3863
Comments
+1 |
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. P.S. You can learn more about why we stale issues here. |
If we did this, we wouldn't have had Shopify/lighthouse-ci-action#87 |
I've created a draft PR with a potential solution for this: #4922, in case someone wants to continue |
I would even suggest having a new output helper named That way you can pick from the list:
|
Please confirm that you have:
In which of these areas are you experiencing a problem?
Other
Expected behavior
I noticed that logging is done by default to STDOUT (even debug logging, for theme check anyway). Shouldn’t that be sent to STDERR by default?
Logging to STDOUT when it isn’t meant to be captured by a script makes the CLI non-composable/non-scriptable.
For instance,
shopify theme check --verbose --output json
will have non-JSON output in STDOUT and makes| jq
break.IMO STDOUT should be intentional, not the default.
Actual behavior
IMO all of these should use STDERR by default. STDOUT is the wrong default.
Verbose output
Reproduction steps
shopify theme check --output json --verbose | jq .
-- get malformed JSON because debug logging isn't JSON.Operating System
All
Shopify CLI version (check your project's
package.json
if you're not sure)3.60
The text was updated successfully, but these errors were encountered: