Skip to content

Remove nameof use from LoggerMessage.Define calls #28159

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

Closed
Tratcher opened this issue Nov 25, 2020 · 3 comments
Closed

Remove nameof use from LoggerMessage.Define calls #28159

Tratcher opened this issue Nov 25, 2020 · 3 comments
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions good first issue Good for newcomers. help wanted Up for grabs. We would accept a PR to help resolve this issue task
Milestone

Comments

@Tratcher
Copy link
Member

Tratcher commented Nov 25, 2020

LoggerMessage.Define<string>(LogLevel.Debug, new EventId(1, nameof(ConnectionStart)), @"Connection id ""{ConnectionId}"" started.");

These names are considered public API and should not be changed even if the thing they're named after changes. As such we don't want to use nameof because the tools would automatically rename them.

Compare to:

LoggerMessage.Define<string, int>(LogLevel.Trace, new EventId(1, "PreparingNonBlockingInvocation"), "Preparing non-blocking invocation of '{Target}', with {ArgumentCount} argument(s).");

@Tratcher Tratcher added good first issue Good for newcomers. help wanted Up for grabs. We would accept a PR to help resolve this issue task area-servers labels Nov 25, 2020
@halter73 halter73 added this to the Next sprint planning milestone Nov 25, 2020
@ghost
Copy link

ghost commented Nov 25, 2020

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@adrianwright109
Copy link
Contributor

I can take this issue, if you're ok with that?

@adrianwright109
Copy link
Contributor

I have submitted a PR which removes the use of nameof from LoggerMessage.Define calls.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 30, 2020
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions good first issue Good for newcomers. help wanted Up for grabs. We would accept a PR to help resolve this issue task
Projects
None yet
Development

No branches or pull requests

4 participants