Skip to content

LoggerMessage - SYSLIB1008 should have a better message #52221

Closed

Description

@eerhardt

I made the mistake of adding static to my LoggerMessage method (through copy-paste mistake) and I wanted to use my instance ILogger _logger field, so I didn't have an ILogger in the method parameters.

I got this error message:

Severity Code	Description	Project	File	Line	Suppression State
Error	SYSLIB1008	One of the arguments to a logging method must implement the Microsoft.Extensions.Logging.ILogger interface Microsoft.Extensions.Diagnostics.HealthChecks C:\git\aspnetcore\src\HealthChecks\HealthChecks\src\HealthCheckPublisherHostedService.cs    207

This message didn't help me right away because I didn't want to pass an ILogger in the arguments. So it took me a while to realize the method was static and that was the issue.

We should update this message to also include that the method is static.

Activity

  1. ghost added
    untriaged
    on May 3, 2021
  2. removed
    untriaged
    on May 3, 2021
  3. added this to the 6.0.0 milestone on May 3, 2021
  4. changed the title [-]SYSLIB1008 should have a better message[/-] [+]LoggerMessage - SYSLIB1008 should have a better message[/+] on May 4, 2021
  5. added a commit that references this issue on May 13, 2021
    22e25fa
  6. ghost added
    in-pr
    on May 13, 2021
  7. ghost removed
    in-pr
    on May 13, 2021
  8. ghost added
    in-pr
    on May 27, 2021
  9. added a commit that references this issue on May 27, 2021
    556768a
  10. ghost removed
    in-pr
    on May 27, 2021
  11. ghost locked as resolved and limited conversation to collaborators on Jun 26, 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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions