Skip to content

Logging Generator: messaging fix #54008

Closed

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

Activity

  1. added
    help wanted
    on Jun 10, 2021
  2. added this to the 6.0.0 milestone on Jun 10, 2021
  3. ghost added
    untriaged
    on Jun 10, 2021
  4. added
    good first issue
    and removed
    untriaged
    on Jun 10, 2021
  5. added a commit that references this issue on Jun 11, 2021
  6. jeffl8n commented on Jun 11, 2021

    @jeffl8n
    Contributor

    @maryamariyan Are the expected/actual cases flipped? Running the current test without any changes is already returning the expected state.

  7. maryamariyan commented on Jun 11, 2021

    @maryamariyan
    ContributorAuthor

    @maryamariyan Are the expected/actual cases flipped? Running the current test without any changes is already returning the expected state.

    hah! yes :) updated

  8. added a commit that references this issue on Jun 11, 2021
    587e538
  9. ghost added
    in-pr
    on Jun 11, 2021
  10. ghost removed
    in-pr
    on Jun 14, 2021
  11. ghost locked as resolved and limited conversation to collaborators on Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Extensions-Loggingbuggood first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions