Closed BramBonne closed 3 years ago
Yeah, the docs are pretty clear here. A PR fixing this would be welcome.
I provided both #199 and #200 as alternative potential fixes to this problem, depending on whether we want directive names to be unique in general (#200), or not (#199).
Hey @jplatte, friendly ping on this. Would #200 be an acceptable way to fix this, or is there a better approach? Thanks for taking a look :-)
Kind regards, Bram
I'll have time on the weekend to take a look at the PR.
Thank you! But no rush, I was just checking it was still being considered 🙂
@jplatte I've taken a look at both of the PRs. Both look good.
I don't have strong preference for either PR, but if I'd have to choose I'd say we should merge #200, as it means more cosistent behaviour across the library in general by always overwriting previous directives. I can't think of an example off the top of my head where this might not be wanted.
I've had a look, I agree that #200 seems like the better solution.
Hey,
Just checking if anything is expected/needed from my end here.
Kind regards, Bram
No. I merged #200. Sorry about the long delay.
Consider the following example (runnable version):
According to the documentation, the
parse_env
function "allows a builder to be configured with default parameters, to be then overridden by the environment". For this example, that would mean thatlog::max_level()
should be set toDebug
at the end of this example. In reality, it's set toTrace
instead.Removing the call to
builder.filter_level(log::LevelFilter::Trace)
correctly sets the log level toDebug
instead.