-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Replace NullLogger with FakeLogger #14982
Conversation
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.
FakeLogger
collects the log messages so you can later retrieve them, in a test. NullLogger
does nothing, nor the mocked loggers. In all of the changed instances, we don't need logging, so NullLogger
or a mock was appropriate, while FakeLogger
is unnecessary and potentially an impact on performance too.
So, I don't agree with any of the changes here. However, you can check whether NullLogger
would be better instead of mock, especially NullLogger<T>.Instance
, since it might be cheaper to construct and use then a mock.
I knew that collecting logs was handy especially in testing, maybe you will notice there's no much value on this PR, but I'm sure
This is true if we use it in the code-base, but I used for testing ONLY |
But we don't do anything with the logs. If we were, then I understand this is only about testing, but test execution performance matters too. |
I will close this for now, but once when need the logs records on the testing |
Then absolutely, just these are not such cases. |
No description provided.