Skip to content

Commit

Permalink
deps: upgrade to env_logger 0.5 and log 0.4
Browse files Browse the repository at this point in the history
Upgrade to env_logger 0.5 and log 0.4 to reduce the need for
projects already using env_logger 0.5 and/or log 0.4 to compile
those libraries multiple times.

This also adds a new `regex` feature which is enabled by default.
A project can disable the regex feature while simultaneously using
`env_logger` by setting quickcheck's `default-features` to `false` and
setting its `features` to `["use_logging"]`.

Closes #201

Signed-off-by: Brian Smith <[email protected]>
  • Loading branch information
briansmith authored and BurntSushi committed Mar 10, 2018
1 parent cfe732d commit 8d3afe3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 12,16 @@ categories = ["development-tools::testing"]
license = "Unlicense/MIT"

[features]
default = ["regex", "use_logging"]
unstable = []
use_logging = ["log", "env_logger"]
default = ["use_logging"]
i128 = ["rand/i128_support"]
regex = ["env_logger/regex"]

[lib]
name = "quickcheck"

[dependencies]
env_logger = { version = "0.4", optional = true }
log = { version = "0.3", optional = true }
env_logger = { version = "0.5", default-features = false, optional = true }
log = { version = "0.4", optional = true }
rand = "0.4"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 129,8 @@ Crate features:
channel.
- `"use_logging"`: (Enabled by default.) Enables the log messages governed
`RUST_LOG`.
- `"regex"`: (Enabled by default.) Enables the use of regexes with
`env_logger`.


### Alternative Rust crates for property testing
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 72,7 @@ macro_rules! quickcheck {

#[cfg(feature = "use_logging")]
fn env_logger_init() -> Result<(), log::SetLoggerError> {
env_logger::init()
env_logger::try_init()
}

#[cfg(not(feature = "use_logging"))]
Expand Down

0 comments on commit 8d3afe3

Please sign in to comment.