All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.plugins.csharp.S6669.html Maven / Gradle / Ivy

There is a newer version: 10.2.0.105762
Show newest version

Why is this an issue?

Sharing some naming conventions is a key point to make it possible for a team to efficiently collaborate. This rule checks that the logger field or property name matches a provided regular expression.

The rule supports the most popular logging frameworks:

How to fix it

Update the name of the field or property to follow the configured naming convention. By default, the following names are considered compliant:

  • {logger}
  • {_logger}
  • {Logger}
  • {_Logger}
  • {log}
  • {_log}

Noncompliant code example

private readonly ILogger myLogger; // Noncompliant

public ILogger MyLogger { get; set; } // Noncompliant

Compliant solution

private readonly ILogger logger; // Compliant

public ILogger Logger { get; set; } // Compliant

Resources

Documentation





© 2015 - 2024 Weber Informatics LLC | Privacy Policy