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

[Feature] Log stdout when commands fail. Fixes #343. #373

Merged
merged 5 commits into from
Jan 28, 2017
Merged

[Feature] Log stdout when commands fail. Fixes #343. #373

merged 5 commits into from
Jan 28, 2017

Conversation

seansfkelley
Copy link
Contributor

@seansfkelley seansfkelley commented Oct 11, 2016

ChildProcessUtilities now returns stdout as the second argument of
a callback. logifyAsync will check for the presence of a second
argument and log it out in the case of an error, too.

Sean Kelley added 2 commits October 11, 2016 13:22
The decorator spec requires that a function decorator either:

- returns a new /descriptor/ for the property, or
- changes the fields on the given descriptor

The logify* methods instead returned a new function implementation, which
is not correct, and caused the decorations to be silently ignored.

decorator spec: https://github.com/wycats/javascript-decorators#detailed-design
function decorator example: https://github.com/jayphelps/core-decorators.js/blob/master/src/deprecate.js

This commit changes logifySync and logifyAsync in the following ways:

- they now have no return value, and instead modify the descriptor
- they now must be called with no arguments so they can properly capture
  the `this` value (without this, the function cannot find the logger instance)
- they now log at 'verbose', because they are extremely verbose
- remove 'error' flag from non-error logging
- they truncate their serialized arguments to (arbitrarily) 100 characters because
  otherwise they they OOM the node process

Additionally, one async method was erroneously decorated with logifySync.
ChildProcessUtilities now returns stdout as the second argument of
a callback. logifyAsync will check for the presence of a second
argument and log it out in the case of an error, too.
@jamiebuilds
Copy link
Contributor

Should we be combining stdout and stderr into a single string to keep things in order?

@jamiebuilds jamiebuilds changed the title Log stdout when commands fail. Fixes #343. [Feature] Log stdout when commands fail. Fixes #343. Nov 16, 2016
@seansfkelley
Copy link
Contributor Author

I hadn't thought of that, but yeah, I think that's the right thing to do. Will take another look Thursday.

@seansfkelley
Copy link
Contributor Author

@thejameskyle finally got around to making those changes.

Copy link
Contributor

@gigabo gigabo left a comment

Choose a reason for hiding this comment

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

Looks fine to me.

Copy link
Contributor

@doug-wade doug-wade left a comment

Choose a reason for hiding this comment

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

woohoo! thanks @seansfkelley

@doug-wade doug-wade merged commit 8aa8980 into lerna:master Jan 28, 2017
@lock
Copy link

lock bot commented Dec 27, 2018

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants