Skip to content

Output retool apps errors to stderr#22

Open
masaru-iritani wants to merge 1 commit intotryretool:masterfrom
masaru-iritani:output_stderr_errors
Open

Output retool apps errors to stderr#22
masaru-iritani wants to merge 1 commit intotryretool:masterfrom
masaru-iritani:output_stderr_errors

Conversation

@masaru-iritani
Copy link
Copy Markdown
Contributor

What

Use console.error instead of console.log to output errors of retool apps.

Why

I'm thinking of adding --json option to retool apps for outputting results in JSON. For that, it's important to differentiate standard outputs from errors. As the initial step, this change replaces all console.log outputting errors with console.error to redirect error messages to stderr, not stdout.

In addition, console.error renders messages in red, so errors stand out more.

How tested

An error message is rendered in red when stdout is redirected to /dev/null.

$ yes | ./lib/index.js apps --delete non_existing_app > /dev/null
0 or >1 Apps named non_existing_app found. 😓

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