Skip to content
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

Add --silent option for a quieter UI #2574

Merged
merged 1 commit into from
Nov 27, 2014
Merged

Conversation

chnn
Copy link
Contributor

@chnn chnn commented Nov 27, 2014

This addresses #2423. Passing --silent to any command will set the UI will only write errors. This allows XML output from ember test to be captured in a file without any additional text (printed ember version, pleasent progress, etc.)

To achieve this, I introduced the concept of a write level / log level to the UI object. UI.write and UI.writeLine now accept a second argument that is the write level. If the write level set for the UI is higher the write level passed to UI.write, nothing will be printed. By default, the write level for a UI object and for UI.write and UI.writeLine is 'INFO'. The write levels, in order, are: 'DEBUG', 'INFO', 'WARNING', 'ERROR'.

This is my first time working in node / on ember-cli—if the implementation is off let me know how I can change it. I would be happy to add tests if all looks well.


// first, run `npm install -g ember-cli`
var npm = this.npm;
var loadNPM = Promise.denodeify(npm.load);

var stopProgress = (function() {
this.ui.pleasantProgress.stop();
this.ui.stopPleasantProgress();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can likely drop the work pleasant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call, could never spell that right anyway

@stefanpenner
Copy link
Contributor

👍 left one tiny OCD comment.

@stefanpenner stefanpenner added this to the 0.1.3 milestone Nov 27, 2014
Passing the --silent command to any command will supress all output from
the UI expect errors.

Introduces write levels to the UI object. Changes pleasant-progress
commands to pass through the UI object first.  The UI simply delegates
the commands to it’s `PleasantProgress` object.
@chnn
Copy link
Contributor Author

chnn commented Nov 27, 2014

Thanks, updated and squashed.

@stefanpenner
Copy link
Contributor

can you add docs in another PR to the site ?

stefanpenner added a commit that referenced this pull request Nov 27, 2014
Add --silent option for a quieter UI
@stefanpenner stefanpenner merged commit 7868f9e into ember-cli:master Nov 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants