-
Notifications
You must be signed in to change notification settings - Fork 21
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
Write informational output to stderr for tail and search #43
Conversation
|
fixed |
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.
I don't seem to understand why we are printing informational statements out to stderr
for just solving non-JSON summary line interference; there are multiple other options:
- making the summary line itself a JSON since it has
<key>: <value>
pairs - or with an extra parameter, making it disappear or appear, with something like
--quiet
or--noSummary
Adding discussions with @matt-march and @andkon, the change is not just to fix #42. That is what started the discussion. It is a move towards good design across the board. We are also keeping the stderr for internal output for both json and regular usecase for the sake of consistency. It is in line with what tools like curl do - something people are already familiar with. This will be a breaking change, and the version change will reflect that but the idea is to just do it the right way rather than add a flag just to satisfy the issue or for not being breaking. |
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.
Okay, just 2 requests:
- including
console.error
addition intoutils.log
instead of creatingutils.error
- adding unit test cases for
utils.log
for now
Since we have never had unit tests for LogDNA CLI
, we can start from here, at least, and then expand.
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.
small requests again
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.
lgtm!
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.
loved very last change
Plaintext summary lines, 'no result' lines, and internal errors are sent to stderr to not interfere with actual data for tail and search.
This also fixes #42 where piping output from tail and search under json flag would break due to summary line.
Before
After