-
Notifications
You must be signed in to change notification settings - Fork 153
feat(logger): introduce log key reordering functionality #2736
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
feat(logger): introduce log key reordering functionality #2736
Conversation
Hi @arnabrahman, thank you for opening this PR! I'll be reviewing it this morning and will get back to you, but overall I think we're going in the right direction. |
I was under the same impression, but looking at the docs again I think we're mistaken, since the docs mention this:
Additionally, in the example they show usage of a key ( With this in mind I think we should follow the same pattern, if possible. I haven't tested this in the code, but at first glance if I remember correctly, I think we should be able to include all keys to the new logic by working with the Doing this will mean we probably remove this line, which I'm not sure if it'll have any impact on the log output. powertools-lambda-typescript/packages/logger/src/formatter/PowertoolsLogFormatter.ts Line 39 in d76eb1d
If this is a viable option, we should also modify the types of the new Let me know if I cleared your questions 😄 |
This summer felt like an eternity but good to be back. I was looking at your suggestions @dreamorosi, on a high level it should be possible to include all the |
Hi @arnabrahman, glad to hear from you again! I hope you had a great summer and some well deserved rest 😃 The errors in the screenshot are strange because the changelog file with issue should be ignored from the markdown lint (here). I will look into it as I have a rough idea of why this is happening, but for now I think it's safe to run the commit with the |
…ogAttributes` keys
…tion during ordering
@dreamorosi So i have progressed well on this. But I have another question. Right now the Currently while creating child, And In this case, if we provide |
Hi @arnabrahman, thank you for the PR - I've started reviewing it and should be able to finish by tomorrow morning at the latest. |
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.
Hi @arnabrahman, thank you so much for the patience while I reviewed this and also for the great work!
I think we are getting very closer, I've left a few comments but the main implementation is done I think.
Let me know if you have any questions or disagree with the comments.
Co-authored-by: Andrea Amorosi <[email protected]>
|
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 @arnabrahman for another great addition and contribution.
I really appreciate you coming back to this and working on the various iterations until we got here.
Thank you again!
PS: I'll reply to your comment on the other issue later today 😉
Summary
By default, we can not change the log key positions. This PR gives the user the ability to change log key positions. We can change log order positions for any keys added in runtime
Changes
logRecordOrder
is added for reordering.formatAttributes
function for the new option.Issue number: #1568
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.