Skip to content

feat: add computed default records#33

Merged
alekseysidorov merged 6 commits into
mainfrom
issue-31-default-record-fn
Jun 30, 2026
Merged

feat: add computed default records#33
alekseysidorov merged 6 commits into
mainfrom
issue-31-default-record-fn

Conversation

@alekseysidorov

Copy link
Copy Markdown
Owner

This MR introduces a new method ContextLogger::with_default_record_fn that allows injecting custom default records based on log record metadata, enabling more flexible and dynamic logging contexts.

Closes #31

Introduce a new method `with_default_records_fn` that allows injecting
custom default records based on log record metadata, enabling more
flexible and dynamic logging contexts.
- with_default_record_fn method now returns generic `V` that can be
  automaticaly converted into LogValue
- Polish documentation
Refactor `check_logger_once` to accept an initialization function
instead of creating the logger directly. This allows tests to configure
the logger with custom records before use. Update existing tests and add
a new test file to demonstrate the new API.
@alekseysidorov
alekseysidorov merged commit af7b452 into main Jun 30, 2026
3 checks passed
@alekseysidorov
alekseysidorov deleted the issue-31-default-record-fn branch July 15, 2026 21:51
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.

Computed default records

1 participant