-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
|
||
// 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(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
👍 left one tiny OCD comment. |
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.
Thanks, updated and squashed. |
can you add docs in another PR to the site ? |
Add --silent option for a quieter UI
This addresses #2423. Passing
--silent
to any command will set the UI will only write errors. This allows XML output fromember 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
andUI.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 toUI.write
, nothing will be printed. By default, the write level for aUI
object and forUI.write
andUI.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.