feat(cli): add --loglevel option#2992
Merged
ikatyang merged 9 commits intoprettier:masterfrom Oct 14, 2017
Merged
Conversation
azz
reviewed
Oct 8, 2017
|
|
||
| exports[`deprecated options are warned (stderr) 1`] = ` | ||
| "\`--flow-parser\` is deprecated. Use \`--parser flow\` instead. | ||
| "warn \`--flow-parser\` is deprecated. Use \`--parser flow\` instead. |
Member
There was a problem hiding this comment.
Could we change it to
warn: `--flow-parser` is deprecated...
or
[warn] `--flow-parser` is deprecated...
Member
Author
Member
There was a problem hiding this comment.
Looks good. It was just but strange without punctuation and without color.
azz
reviewed
Oct 9, 2017
|
|
||
| exports[`show all logs with --loglevel debug (stderr) 1`] = ` | ||
| "[warn] Ignored unknown option: --unknown-option | ||
| [debug] normalized argv: {\\"_\\":[\\"not-found.js\\"],\\"bracket-spacing\\":false,\\"color\\":true,\\"debug-check\\":false,\\"debug-print-doc\\":false,\\"flow-parser\\":false,\\"insert-pragma\\":false,\\"jsx-bracket-same-line\\":false,\\"list-different\\":false,\\"require-pragma\\":false,\\"semi\\":false,\\"single-quote\\":false,\\"stdin\\":false,\\"use-tabs\\":false,\\"version\\":false,\\"with-node-modules\\":false,\\"write\\":false,\\"loglevel\\":\\"debug\\",\\"parser\\":\\"unknown-parser\\",\\"ignore-path\\":\\".prettierignore\\",\\"config-precedence\\":\\"cli-override\\"} |
Member
Author
There was a problem hiding this comment.
It seems it'd be better to use expect(...).toMatch(/[loglevel]/) in this case.
lydell
reviewed
Oct 10, 2017
| expect(result.stderr).toMatch(pattern); | ||
| }); | ||
| } else { | ||
| expect(result.stderr).toMatch(/\s*/); |
Member
There was a problem hiding this comment.
What is this supposed to do? Any string matches /\s*/, right?
Member
Author
There was a problem hiding this comment.
Oops, I forgot to add ^+$
azz
approved these changes
Oct 10, 2017
lydell
approved these changes
Oct 13, 2017
lipis
added a commit
to lipis/prettier
that referenced
this pull request
Oct 14, 2017
…ettier/md * 'master' of https://github.com/prettier/prettier: feat(cli): add `--loglevel` option (prettier#2992)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #2939
PRETTIER_LOG_LEVELinternally.chalkdirectly sincedebugenforces trailing+0mss and it looks weird in some cases.stderrwith its loglevel, e.g.error,warn, etc.unknownminimist option tonormalizeConfigQuestion:
--debug-checkresults to stdout? We now prefix every message to stderr witherror/warn/etc.and its functionality looks similar to--list-different.