Skip to content
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

Match all submodules on with_module_level #27

Merged
merged 2 commits into from
Oct 8, 2020

Conversation

piegamesde
Copy link
Contributor

Added a test, just to be sure.

Also some examples were missing a unwrap() after calling init(), fixed that too.

Closes #24.


I'm unsure about with_target_levels, since that takes a HashMap and we don't use that anymore (for now). Changing this is a bit tricky due to backwards compatibility. I think I could modify this into something that take an impl IntoIterator<(String, LevelFilter)> or the like so that the actual data structure is hidden as an implementation detail. Also I'm not sure about the semantics of that method, why does it overwrite all existing level filters instead of adding them? Can I change this or is this considered a breaking change? (@creekorful you wrote this, any opinions?)

Added a test, just to be sure.

Also some examples were missing a `unwrap()` after calling `init()`, fixed that too.

Closes borntyping#24.
Copy link
Contributor

@creekorful creekorful left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @piegamesde !

I have reviewed your PR, and have some little questions!


Regarding with_target_levels I don't think we should keep the method. It was added on my first commit f02c401 before the builder pattern was available. Before that, one needed to initialize the logger in one time, that's why the method does overwrite the level filters.

When I have implemented the builder pattern, I have simply move the method without thinking about the implications (😅), even the name target does not make sense now.

I would simply remove the method since people should use with_module_level instead. I know it should raise major version as it is a breaking change, but If we take time to perform reverse dependency analysis, I think nobody use this method anyway. Raising simply the minor version should be sufficient, as it will cause a compile time error for the caller, so nothing will be hidden.

What do you think @borntyping @piegamesde ?

src/lib.rs Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
@piegamesde
Copy link
Contributor Author

Thanks for the review!

I'll deprecate with_target_levels then and we'll be free to remove it on the next major version bump. It doesn't harm us keeping that around right now.

@creekorful
Copy link
Contributor

Thanks for the review!

I'll deprecate with_target_levels then and we'll be free to remove it on the next major version bump. It doesn't harm us keeping that around right now.

Great! I've just had a little suggestion regarding the module ordering implementation, otherwise everything LGTM!

Thanks for the feature, this will definitely be helpful :)

@creekorful
Copy link
Contributor

Hello there @borntyping @piegamesde!

Any news on when this will be merged? :)

@borntyping
Copy link
Owner

Just waiting on CI checks to all pass.

@borntyping borntyping merged commit cd73036 into borntyping:master Oct 8, 2020
@borntyping
Copy link
Owner

Passed with a retry :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wildcard for with_module_level
3 participants