powertools-lambda-typescript
powertools-lambda-typescript copied to clipboard
feat(logger): introduce log key reordering functionality
Summary
By default, we can not change the log key positions. This PR gives the user the ability to change log key positions.
Changes
- This is a WIP PR
- Mostly followed the recommendations from the comment from the actual issue.
- A new option
logRecordOrder
is added for reordering. - Change
formatAttributes
function for the new option. - For now
logRecordOrder
holds the keys ofUnformattedAttributes
type - But looking at the python powertools doc, i believe we should type the option for standard structured keys. As far as i understand
PowertoolsLog
holds the type to the structured keys mentioned in the doc. Please correct me if i am wrong.
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.