fix(verbose): verbose-style logging is consistent#362
Merged
Conversation
Contributor
|
Can we add a test that verbose mode works with echo? Otherwise than that, LGTM! |
Member
Author
|
@ariporad I fixed one of the tests to check that echo is logged (it previously allowed it not to be logged, since it wasn't wrapped) |
| assert.equal(result.stdout, 'ls file_doesnt_exist\n1234\n'); | ||
| assert.equal(result.stderr, 'ls: no such file or directory: file_doesnt_exist\n'); | ||
| assert.equal(result.stdout, '1234\n'); | ||
| assert.equal(result.stderr, 'ls file_doesnt_exist\nls: no such file or directory: file_doesnt_exist\necho 1234\n'); |
Member
Author
There was a problem hiding this comment.
@ariporad here's an example where it tests echo() being logged
Merged
Contributor
|
LGTM! |
ariporad
added a commit
that referenced
this pull request
Feb 19, 2016
fix(verbose): verbose-style logging is consistent
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This fixes a couple issues with
config.verboselogging, and some related things.set('-v')previously didn't logecho()commands because those weren'tcommon.wrap'edecho()is now wrapped, but is designed to still allow echoing strings that start with "-" (ex. "-1*3+5") (see issue Cannot echo a string that starts with - #20)echo()still does not glob. This is because 1. globbing isn't that useful forecho()in my opinion, and 2. echo is frequently used enough that it should have good performance by defaultset('-v')-style logging goes to stderr, not stdout. This resembles Bash's behavior withset -vThe way this is implemented,
echo()still doesn't support any options, but we may want to consider allowing for that in the future (-ncomes to mind). It'd be pretty easy to add support for that option once this is merged.Also, it simplifies things if
echo()is wrapped, since it ensures that commands likeecho(pwd())still work the same, even if #360 lands.