-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
feat: Add WithLogger(ILogger)
builder API
#1100
Conversation
✅ Deploy Preview for testcontainers-dotnet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Continuing discussion from #1093 (comment) to here (where it belongs).
Indeed this pull request does include the new Xunit project. I will submit another pull request dedicated to the new Xunit integration.
It's big because it removes the
I tried but I don't see how it's possible to split in two steps. Again, if you ignore the required changes in the modules the core feature diff is not that big. |
952ffe5
to
ccaa317
Compare
I haven't had the time yet, but I will review it in the next few days. |
Great, I'll refrain from submitting new pull requests in the meantime. 😉 |
…ders This will enable a seamless integration with xUnit.net (both ITestOutputHelper and IMessageSink) Fixes testcontainers#996
ccaa317
to
3a2d37e
Compare
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.
It took me some time to review everything, and as I got closer to completion, I identified and refactored a couple of crucial parts. As mentioned in a previous comment, I would like to avoid logging the runtime information either too frequently (as is the case now) or just once in cases where developers cannot easily find it. While it still requires some polishing, I believe we are very close now. I have included tests to ensure that the runtime information is only logged once per logger instance (LoggerTest
). This guarantees the presence of the runtime information in cases where developers use the ITestOutputHelper
, which, IMO, looks quite good. I can provide more details and necessary follow-ups tomorrow, but for today, I am finished and tired. If you have some time to review the changes as well, that would be awesome and much appreciated. I am certain that we can make further improvements.
…et into 0xced-ILoggerBuilder
…et into 0xced-ILoggerBuilder
WithLogger(ILogger)
builder API
The PR is ready for a final review. @0xced your feedback is much appreciated (no hurry). I am happy to merge the PR afterward. |
Awesome, I'll try to have a look this week. |
I just pushed 1ee0e3e which uses the configured I think the configured logger should also be passed to the |
We can also change this with a follow-up PR. Probably, we simply need to replace the singleton property with a method that provides an ILogger overload. |
OK, let's take care of I see that you removed the structured logging of runtime information that I had introduced. I re-introduced it in a slightly improved way in fef7faa. I think it makes the One last question: why did you introduce an empty |
Can we please revert it? I really do not like it, and structured logging does not have a lot of benefits here. I would like to remove |
OK fine, I’ll revert. What about the empty
Could you please have a look at #1139 before publishing? I promise it’s much simpler than this one. 😉 |
This guarantees lazy initialization (probably not really important here), see beforefieldinit.
Yes, we can merge this before publishing a beta version too. |
I just pushed 1bf2f96 which removes the structure logging and I extracted the logging code into a new method for improved readability, and also catching only the exceptions when running
Wow, I had no idea, gotta agree with Mike Marynowski!
I think it's now ready to be merged. 😀 |
What does this PR do?
This pull request moves the logger configuration from the static
TestcontainersSettings
class to the AbstractBuilder class.Before:
After:
Why is it important?
This will enable a seamless integration with xUnit.net (both with
ITestOutputHelper
and withIMessageSink
).Related issues
Fixes #996