-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revamp the logging generator to use the new redaction model. #4233
Conversation
0e6ba86
to
32dcce8
Compare
Why is that? You can add |
@@ -619,36 +618,12 @@ class MyClass | |||
internal static partial class C | |||
{ | |||
[LogMethod(0, LogLevel.Debug, ""Only {A}"")] | |||
static partial void M(ILogger logger, IRedactorProvider provider, [FeedbackData] string a, [LogProperties] MyClass param); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @klauco pointed, we should still support this use-case. Maybe not in 3P though 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing redactor provider support was a huge simplification. I'd really need to be convinced that supporting it is a useful thing within the redaction infra.
Note that there's nothing preventing the customer from grabbing an IRedactorProvider themselves and redacting stuff on their own before calling the lower-level log method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we provide analyzer and fixer for existing customers, to move to the signature which does not use IRedactorProvider?
Oh, let me try that. I was trying to figure out how to change the default minimum level and just didn't land on a solution. |
This new code leverages LoggerMessageState to take advantage of the new ExtendedLogger design.
The tests were updated for three reasons:
Stopped using IRedactorProvider in here, this is handled by
the ExtendedLogger
Fixed brittle test logic assuming the order of the name/value pairs
produced by the logging code generator. The tests are now order-
independent.
Microsoft Reviewers: Open in CodeFlow