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

Add event names for logs (#6818) #4495

Merged
merged 2 commits into from
Dec 8, 2018
Merged

Add event names for logs (#6818) #4495

merged 2 commits into from
Dec 8, 2018

Conversation

pranavkm
Copy link
Contributor

@pranavkm pranavkm commented Dec 7, 2018

Copy link
Member

@dougbu dougbu left a comment

Choose a reason for hiding this comment

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

How visible will these new names be? If they'll appear in the output, we might want to be more consistent about Starting… -> Done… versus Before… -> After… or other conventions we've used. But, I don't see a need to block this PR for decisions on the right convention.

"Could not bind to collection using a format like {ModelName}=value1&{ModelName}=value2");


Copy link
Member

Choose a reason for hiding this comment

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

Don't need this extra blank line

"Executed action method {ActionName}, returned result {ActionResult} in {ElapsedMilliseconds}ms.");

_logFilterExecutionPlan = LoggerMessage.Define<string, string[]>(
LogLevel.Debug,
1,
new EventId(1, "LogFilterExecutionPlan"),
Copy link
Member

Choose a reason for hiding this comment

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

This name doesn't look like any of the others. Suggest FilterExecutionPlan or OrderedFilterExecutionPlan.

5,
"Located compiled view for view at path '{Path}'.");

_viewCompilerLocatedCompiledViewForPath = LoggerMessage.Define<string>(
Copy link
Member

Choose a reason for hiding this comment

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

👍

@pranavkm
Copy link
Contributor Author

pranavkm commented Dec 8, 2018

How visible will these new names be?

From aspnet/Mvc#6818 (comment), the names appear in the log output and used for filtering. I guess it's important that it's unique, but the issue doesn't say much about the nomenclature.

Copy link
Member

@dougbu dougbu left a comment

Choose a reason for hiding this comment

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

Looking even better 😸

@pranavkm pranavkm merged commit 027bf33 into master Dec 8, 2018
@pranavkm pranavkm deleted the prkrishn/6818 branch December 8, 2018 07:30
@pranavkm
Copy link
Contributor Author

pranavkm commented Dec 8, 2018

@Kahbazi thanks for the PR

@BrennanConroy
Copy link
Member

FYI, we try to avoid using nameof for the event names as changing them is "technically" a breaking change and it's easier to avoid accidentally changing the name by using strings instead of function names.
Couple examples: https://github.com/aspnet/AspNetCore/blob/321327f84b2b22dcff2e9beb06a9a64236c5cced/src/SignalR/src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.Log.cs
and
https://github.com/aspnet/Extensions/blob/1878d16ecd5165849cd6a78ce708e499b71477ca/src/HttpClientFactory/Http/src/DefaultHttpClientFactory.cs#L337

@Kahbazi
Copy link
Member

Kahbazi commented Dec 8, 2018

@pranavkm you're welcome. Should I remove the nameof as @BrennanConroy said?

@pranavkm
Copy link
Contributor Author

pranavkm commented Dec 9, 2018

Should I remove the nameof as @BrennanConroy said?

Go for it!

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.

4 participants