Skip to content

include default meta in addMeta overwrite method#303

Open
shimms wants to merge 1 commit into
fullstack-build:masterfrom
shimms:feat/include_default_meta
Open

include default meta in addMeta overwrite method#303
shimms wants to merge 1 commit into
fullstack-build:masterfrom
shimms:feat/include_default_meta

Conversation

@shimms

@shimms shimms commented Sep 16, 2024

Copy link
Copy Markdown

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.

terehov added a commit that referenced this pull request Jun 27, 2026
Port of #303. When overwrite.includeDefaultMetaInAddMeta is true, the
default runtime meta is passed as the 4th argument to a custom
overwrite.addMeta handler so it can extend the default meta instead of
replacing it. Defaults to false, so existing handlers are unaffected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant