Conversation
…ateLogger` for level convenience methods (e.g. `.info()`, `.silly()`).
Member
Author
2 tasks
Contributor
|
I'll review it first thing tomorrow. Thanks for the ping |
DullReferenceException
approved these changes
Jan 29, 2019
DABH
approved these changes
Jan 29, 2019
Contributor
DABH
left a comment
There was a problem hiding this comment.
Tests look good. Seems like the key thing is to use functions instead of arrow functions in the appropriate places due to the different binding behaviors, which makes sense -- don't think this is too unusual :)
2 tasks
Mizumaki
pushed a commit
to Mizumaki/winston
that referenced
this pull request
Jun 11, 2020
* [fix wip] Attempt to fix winstonjs#1577. * [fix test] Fallback to the "root" instance **always** created by `createLogger` for level convenience methods (e.g. `.info()`, `.silly()`). * [tiny] Remove useless assignment. * [tiny] DRY it up a little.
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.
@kibertoad not an expert on prototypal semantics through
Object.create, but I grok most of what the issue is.I haven't 100% solved it, and I'm (frankly) not satisfied with re-creating the convenience methods for levels (e.g..info, etc) for each.child()call, but I don't see a way around it.Also played around with what's the most performant way to set the helpers in this jsperf for anyone interested.
Only one test is failing, but that's somewhat obvious since it's usingObject.create.Noticed that your branch did not pass CI either. Thoughts?
UPDATE: current implementation supports both unbound, stateless functions and
Object.create(logger, props)scenarios. The underlying implementation is ... let's say unusual ... but I ran it againstpinobenchmarks and there was no material degradation in performance.cc/ @DABH