Skip to content

feat: commonLoggerCreate accepts a context function, read on every call - #162

Merged
fiddur merged 2 commits into
mainfrom
feat/common-logger-context-fn
Sep 28, 2026
Merged

fiddur merged 2 commits into
mainfrom
feat/common-logger-context-fn

Conversation

@fiddur

@fiddur fiddur commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

commonLoggerCreate(sink, context) and child(context) now also take () => AnyObject. A function is called on every log call; a plain object is still copied once. child merges either form, child keys win.

Motivation: loggers on objects whose context is filled in after creation, e.g. RequestContext

For loggers on objects whose context is filled in after creation, e.g a
RequestContext that resolves its user later. `child` merges either form.

Claude-Session: https://claude.ai/code/session_01JuGyKbJyWXdXBeNS7VdnU1
@fiddur
fiddur marked this pull request as ready for review September 24, 2026 15:07
… object

Normalise the context into one getter at creation; child merges the getters.

Claude-Session: https://claude.ai/code/session_01JuGyKbJyWXdXBeNS7VdnU1
@fiddur
fiddur merged commit dea5f8b into main Sep 28, 2026
3 checks passed
@fiddur
fiddur deleted the feat/common-logger-context-fn branch September 28, 2026 12:12
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.

2 participants