-
Notifications
You must be signed in to change notification settings - Fork 2.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
Fix logifyAsync, logifySync decorators. #372
Merged
Merged
Conversation
This file contains 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
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.
AppVeyor's 0.10 build failed with permissions issues, per usual... |
Hey @hzoo / @thejameskyle, this is a pretty bad bug to leave lying around. Can this (and hopefully #373 too) get merged sooner rather than later? |
Thank you! |
douglasduteil
pushed a commit
to douglasduteil/lerna
that referenced
this pull request
Oct 20, 2016
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.
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The decorator spec requires that a function decorator either:
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:
the
this
value (without this, the function cannot find the logger instance)otherwise they they OOM the node process
Additionally, one async method was erroneously decorated with logifySync.