rust-cli / env_logger

A logging implementation for `log` which is configured via an environment variable.
https://docs.rs/env_logger
Apache License 2.0
782 stars 124 forks source link

Issue with `anstream` optional dependency #312

Closed vantessel closed 4 months ago

vantessel commented 4 months ago

Running cargo add log env_logger in a fresh crate gives me this error:

error: failed to select a version for `env_logger`.
    ... required by package `testlog v0.1.0`
versions that meet the requirements `^0.11.2` are: 0.11.2

the package `testlog` depends on `env_logger`, with features: `anstream` but `env_logger` does not have these features.
 It has an optional dependency with that name, but that dependency uses the "dep:" syntax in the features table, so it does not have an implicit feature with that name.

failed to select a version for `env_logger` which could resolve this conflict

It works fine with version 0.10.2

epage commented 4 months ago

FYI v0.11's MSRV is 1.71 so we could rely on a fix in cargo related to feature declarations. Unfortunately, cargo reports the error before checking the MSRV.

This previously came up in #304.