tslog icon indicating copy to clipboard operation
tslog copied to clipboard

include default meta in `addMeta` overwrite method

Open shimms opened this issue 1 year ago • 0 comments

The current implementation of overwrite.addMeta does not make it easy to get the runtime's default meta if you're just looking to extend it with additional pieces of meta information (such as a request ID).

This PR allows the default meta to be passed into the overwrite method so that you can return it again, preserving existing behaviour whilst giving you an entry point to extend the meta, rather than replace it.

This has been done in a non-breaking way, existing implementations will work without any changes, whilst the API allows you to provide an optional new argument to populate the default meta. Existing uses of tslog will be unaffected by this change.

shimms avatar Sep 16 '24 10:09 shimms