Skip to content

Logging Generator: messaging fix #54008

@maryamariyan

Description

@maryamariyan

Repro code:

public static partial class ABC
{
    [LoggerMessage(EventId = 0, Level = LogLevel.Debug, Message = "{foo}")]
    static partial void M1(ILogger logger);
}

For TemplateHasNoCorrespondingArgument, instead of passing 't' as an argument to the diag method, it should be passing t.Key (the name of the template).

Diag(DiagnosticDescriptors.TemplateHasNoCorrespondingArgument, ma.GetLocation(), t);

Actual

Template [foo, foo] is not provided as argument to the logging method

Expected

Template "foo" is not provided as argument to the logging method

cc: @geeknoid

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Extensions-Loggingbuggood first issueIssue should be easy to implement, good for first-time contributorshelp wanted[up-for-grabs] Good issue for external contributors

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions