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 |
dreamorosi
left a comment
There was a problem hiding this comment.
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
createChildcreate a child logger without options, it didn't inherit the parents' attributes.Attributes affected:
logLevelcustomConfigServicelogFormatterExample:
But it will be
DEBUGsince it is the default value:Description of your changes
Missing parent's attributes are added to
optionsbefore merging with childoptionsthat suppose to overwrite them.It was missed because existing tests compare attributes against default values. I added a test with all possible parent's
optionswith 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.