Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MsgFunc function added to Event #406

Merged
merged 1 commit into from Feb 3, 2022
Merged

MsgFunc function added to Event #406

merged 1 commit into from Feb 3, 2022

Conversation

RobRimmer
Copy link
Contributor

@RobRimmer RobRimmer commented Feb 3, 2022

Allows lazy evaluation of msg, only if log level is appropriate.
Useful if formatting of log message is expensive and rarely used (e.g. in depth trace logs)
Closes #405

@rs
Copy link
Owner

rs commented Feb 3, 2022

Please call it MsgFunc as all methods of Event are lazy.

Allows lazy evaluation of msg text, only if log level is appropriate.
@RobRimmer RobRimmer changed the title MsgLazy function added to Event MsgFunc function added to Event Feb 3, 2022
@rs rs merged commit fc26014 into rs:master Feb 3, 2022
pablitoc pushed a commit to nxcr-org/zerolog that referenced this pull request Apr 7, 2023
Allows lazy evaluation of msg text, only if log level is appropriate.
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.

Feature request: Lazy evaluation of the Msg field (see PR #406)
2 participants