-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[dotnet] Internal logging #13140
[dotnet] Internal logging #13140
Conversation
Thank you for this feature implementation, @nvborisenko. Let me please review this PR a bit. Overall implementation is fine, as for me, "ambient context" looks like a good way to inject logging in the current state of WebDriver without breaking changes. I believe in the future WebDriver versions we'll be able to have it injected/configured through Anyway, I have a couple of recommendations regarding the logging API. I would merge Configure global loggingLog.SetLevel(Level.Trace);
// ->
LogContext.Global.SetLevel(Level.Trace); Where Adjust logging per testLog.ForContext.SetLevel(Level.Trace).AddHandler(new ConsoleLogHandler());
// ->
LogContext.ConfigureAmbient().SetLevel(Level.Trace).AddHandler(new ConsoleLogHandler()); Currently, if you call twice So I would replace Logger initializationprivate readonly ILogger _logger = Log.ForContext.GetLogger<HttpCommandExecutor>();
// ->
private readonly ILogger _logger = LogContext.ResolveLogger<HttpCommandExecutor>();
|
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## trunk #13140 +/- ##
==========================================
+ Coverage 57.53% 57.95% +0.42%
==========================================
Files 86 88 +2
Lines 5310 5333 +23
Branches 221 224 +3
==========================================
+ Hits 3055 3091 +36
+ Misses 2034 2018 -16
- Partials 221 224 +3 ☔ View full report in Codecov by Sentry. |
|
What is the thought behind naming it |
No logs by default at all. User should explicitly turn it on.
Should we implement it as well?
It is clearer that SetMinimumLevel(Trace) will emit logs with |
I really think we should turn it on by default, and just not log anything at the default level unless it is important. Yes, ideally we have a Handler implementation that can stream to stdout, stderr or file |
I returned back |
Do you know what the test failures are from? |
This PR is ready for review. API is stabilized, user is able to do whatever he wants. We still don't have the implementation of Build is failing, I have no ideas why. |
This reverts commit e3255a6.
Thanks for all of your work on this @YevgeniyShunevych & @nvborisenko !! |
We need logging for .net.
Description
There is single entry point
Log
, butContext
aware.Usage:
Motivation and Context
We need logging for .net.
Types of changes
Checklist