powertools-lambda-typescript icon indicating copy to clipboard operation
powertools-lambda-typescript copied to clipboard

feat(logger): introduce log key reordering functionality

Open arnabrahman opened this issue 7 months ago • 4 comments

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 of UnformattedAttributes 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.

arnabrahman avatar Jul 05 '24 08:07 arnabrahman