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

Fix lazy evaluation of log arguments #399

Merged
merged 1 commit into from
Apr 18, 2024
Merged

Conversation

s-ludwig
Copy link
Member

@s-ludwig s-ludwig commented Apr 16, 2024

if (!getLoggers().any!(l => l.minLevel <= level))
return;

T args_copy = args;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't compile because if T.length == 0 args_copy is undefined

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this is inside of static if (T.length != 0) { ... }, so it should still work.

Copy link
Contributor

@Boris-Barboris Boris-Barboris Apr 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see, my fork is stuck in an old version where formattedWrite is not in static if block

@s-ludwig s-ludwig merged commit e99d0e3 into master Apr 18, 2024
12 checks passed
@s-ludwig s-ludwig deleted the fix_lazy_log_evaluation branch April 18, 2024 19:34
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.

3 participants