-
Notifications
You must be signed in to change notification settings - Fork 11
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
Mention MinimumLevel.Debug in README re #17 #18
base: dev
Are you sure you want to change the base?
Conversation
Added instructions for chaining debug level call. Also the same for the XML and JSON config.
@@ -15,6 +15,7 @@ Then enable the sink using `WriteTo.Debug()`: | |||
```csharp | |||
Log.Logger = new LoggerConfiguration() | |||
.WriteTo.Debug() | |||
.MinimumLevel.Debug() |
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.
have been looking at the serilog readme, and the MinimumLevel
is not mentioned there either.
Space in there is at a premium, so even though it might trip quite a few people up, there's a very high bar for making the readme longer.
Also conflicted about whether I'd put this line here as it might suggest to people some linkage between this Sink being called Debug and the min level being Debug ?
@@ -24,6 +25,10 @@ Log events will be printed to the debug output: | |||
|
|||
![Debug Output](https://raw.githubusercontent.com/serilog/serilog-sinks-debug/dev/assets/Screenshot.png) | |||
|
|||
The chaining of the `MinimumLevel.Debug()` call is required in order to log events of level `LogEventLevel.Debug`, as the default minimum level for a new `LoggerConfiguration` is `LogEventLevel.Information`. |
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.
Perhaps instead of this, if we got a screenshot that did not include Debug output?
Or linked:
https://github.com/serilog/serilog/wiki/Configuration-Basics#minimum-level
with a message like
⚠️ The default minimum log level isInformation
. To outputDebug
(DBG
in the above screenshot), theLoggerConfiguration
must opt into the lower level, or the log message won't enter the output pipeline.
Thanks @Reeceeboii - I added two notes on the PR. Your PR does the job, but on reflection, maybe the notice/example re the minimum level for a LoggerConfiguration belongs somewhere else (in Serilog Core?) I do agree that it's misleading and infuriating for the config in the readme not to be able to produce the output in the screenshot without any hint as to how to bridge the gap - that will definitely wind up resolved. I'm not sure what the overall view is - let's wait for others to review and we'll get there. |
Roger that. Will hang tight. This PR is open for maintainer changes so if I can't be reached in a timely manner and you have a way forward then I don't mind if others run this up 👍 |
I agree that the inclusion of What if we were to (at worst 😅) just edit the screenshot to show Ideally, I think the page https://github.com/serilog/serilog/wiki/Getting-Started, which we link prominently from the README, would carry some information about minimum level settings. |
I think part of the confusion from my end (that led to me raising #17 originally) was that I wanted to write I suppose my mind made the implicit link between the debug console sink and logs at a I do wonder if this is actually an issue worthy of a fix - if nobody else has raised this before, we could chalk it up to the way my brain was wired when attempting to integrate this sink. It was confusing me until I had mentally uncoupled the two separate uses of 'debug'. |
I have not actually used the sink myself (and I should) Sometimes I want to be able to up the Debug window trace level when Debugger.IsAttached I dont know if there are good patterns for that written up somewhere in a blog post I missed somewhere. I do think there is a case to answer, and this lib can be a place for a given right paragraph or two of examples or overviews to be housed as part of the overall offering. But handwaving that vs actually writing it well are very different things! |
Fixes #17.
Please let me know if you think anything needs adding or wording needs changing.