-
Notifications
You must be signed in to change notification settings - Fork 154
fix(logger): fix a bug when child logger didn't get all the parent's attributes #1267
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(logger): fix a bug when child logger didn't get all the parent's attributes #1267
Conversation
Thanks for opening this PR. We have a number of other items high on priority before we can look into this issue and verify this PR, but we'll get back to you. |
…it depends on random
Hi @saragerion, thank you for the reply! That is great that test failed in CI because I ran it locally several times, and it was passed. I revisited the code, and since |
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.
Thank you @shdq for the bias for action on this PR.
I've run the integration tests on this branch and they are passing.
Let's go!
I just ran into this issue with child loggers not inheriting the parent's If I'm correct, it looks like it should be released as part of an upcoming |
I can confirm that we upgraded to |
Indeed, we have just released the new version and the issue should be fixed. Happy to hear, thank you for following up! |
I'm glad to hear that. Thank you for the feedback! |
When
createChild
create a child logger without options, it didn't inherit the parents' attributes.Attributes affected:
logLevel
customConfigService
logFormatter
Example:
But it will be
DEBUG
since it is the default value:Description of your changes
Missing parent's attributes are added to
options
before merging with childoptions
that suppose to overwrite them.It was missed because existing tests compare attributes against default values. I added a test with all possible parent's
options
with non-default values and found all the affected attributes.How to verify this change
Related issues, RFCs
Issue number: #1264
PR status
Is this ready for review?: YES
Is it a breaking change?: NO
Checklist
Breaking change checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.