-
Notifications
You must be signed in to change notification settings - Fork 751
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The logging code generator wasn't aware of the NoDataClassification attribute and treated the associated data as having in fact a data classification. This led to an incorrect warning. In addition, what should have been a warning was treated like an error and aborted compilation. Now, if the legit problem occurs, it will be reported as warning and not stop compilation. Co-authored-by: Martin Taillefer <[email protected]>
- Loading branch information
Showing
6 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
test/Generators/Microsoft.Gen.Logging/TestClasses/Bug5188.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Microsoft.Extensions.Compliance.Classification; | ||
using Microsoft.Extensions.Logging; | ||
|
||
public static partial class Bug5188 | ||
{ | ||
internal record User() | ||
{ | ||
public int Id { get; set; } | ||
|
||
[NoDataClassification] | ||
public string? Email { get; set; } | ||
} | ||
|
||
internal static partial class Logging | ||
{ | ||
[LoggerMessage(6001, LogLevel.Information, "Logging User: {User}")] | ||
public static partial void LogUser(ILogger logger, [LogProperties] User user); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters