Drakulix / simplelog.rs

Simple Logging Facility for Rust
https://docs.rs/simplelog/
Apache License 2.0
439 stars 73 forks source link

implemented allow and ignore filtering #36

Closed ryankurte closed 5 years ago

ryankurte commented 5 years ago

This allows the specification of a allowed or ignored modules for logging using the configuration filter_allow and filter_ignore fields, somewhat mitigating #3.

As this introduces new fields to an object that can be publicly constructed (eg. using Config{..}), this is a breaking change. If you wanted to mitigate this in future i would suggest moving to a builder pattern for constructing the Config object and adding a private field to disable public construction.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-1.2%) to 72.325% when pulling d164bfc9634a358aaae6a58cecf3cdd6faef776f on ryankurte:feature/allow-ignore-lists into 9e46c41d2d69323b3a7fcb7ca5568ee9571ca588 on Drakulix:master.

Drakulix commented 5 years ago

Thanks! This looks like a good approach / feature, I will give it a real review sometime next week and likely merge and release it then.

Drakulix commented 5 years ago

Merged manually with #37

aav commented 4 years ago

is there any reason why filtering is based on Record::module_path and not Record::target, as suggested in the log crate?

... A log request consists of a target, a level, and a body. A target is a string which defaults to the module path of the location of the log request, though that default may be overridden. Logger implementations typically use the target to filter requests based on some user configuration. ...