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

Unable to log any trace output #44

Closed
CraZySacX opened this issue Sep 13, 2016 · 2 comments
Closed

Unable to log any trace output #44

CraZySacX opened this issue Sep 13, 2016 · 2 comments

Comments

@CraZySacX
Copy link

CraZySacX commented Sep 13, 2016

No matter how I configure my Cargo.toml, I am unable to produce any trace output.

The latest attempt is below:

[dependencies.slog]
version = "1.0.0-alpha6"
default-features = false
features = ["release_max_level_trace", "max_level_trace"]

After digging around a bit I believe the culprit is Cargo not honoring the default-features = false flag.

It seems that all the features are enabled (in this case, "release_max_level_info, release_max_level_trace, max_level_debug, and max_level_trace"). Due to the if clause in lib.rs, and a normal debug build, "max_level_debug" is always hit, and trace can never be enabled.

Update
Running cargo build --verbose shows the following passed to rustc (and includes all 4 dependencies):

     Running `rustc /home/jozias/projects/slog-rs/src/lib.rs --crate-name slog --crate-type lib -g --cfg feature=\"max_level_trace\" --cfg feature=\"release_max_level_info\" --cfg feature=\"max_level_debug\" --cfg feature=\"default\" -C metadata=b5fec68b10428a12 --out-dir /home/jozias/projects/trace/target/debug/deps --emit=dep-info,link -L dependency=/home/jozias/projects/trace/target/debug/deps`

So this looks like a bug in Cargo where it isn't removing the default dependencies even when default-features = false is used.

I'm going to open an issue on the cargo project.

@CraZySacX
Copy link
Author

For reference, here is the issue in the cargo project:

rust-lang/cargo#3090

@dpc
Copy link
Collaborator

dpc commented Sep 13, 2016

Good find. Thanks for report.

@dpc dpc closed this as completed in 8042197 Sep 14, 2016
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

No branches or pull requests

2 participants