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

Depend on winapi-util 0.1.3 #64

Merged
merged 1 commit into from
May 15, 2020
Merged

Depend on winapi-util 0.1.3 #64

merged 1 commit into from
May 15, 2020

Conversation

Alexendoo
Copy link
Contributor

The package depends on things added in that version - BurntSushi/winapi-util@d33486e

Fixes issues such as rust-lang/cargo-bisect-rustc#89

The package depends on things added in that version - BurntSushi/winapi-util@d33486e

Fixes issues such as rust-lang/cargo-bisect-rustc#89
Alexendoo added a commit to Alexendoo/cargo-bisect-rustc that referenced this pull request May 15, 2020
The dependency on 0.1.2 was missing a few things, so it wouldn't build
on windows

Fixes rust-lang#89

Submitted to console too - console-rs/console#64
@pksunkara pksunkara merged commit 01eb40c into console-rs:master May 15, 2020
@Alexendoo Alexendoo deleted the patch-1 branch May 15, 2020 17:02
@charlespierce
Copy link

@pksunkara Would it be possible to get this fix included in a release on Crates.io?

@pksunkara
Copy link
Collaborator

Done.

@charlespierce
Copy link

Awesome, thanks @pksunkara! Appreciate it!

dtolnay pushed a commit to dtolnay-contrib/console that referenced this pull request Feb 4, 2022
With the `fmt` layer being added by default, plus this layer filtering
for `RUST_LOG=tokio=trace`, it can be rather noisy. I think we can
remove the fmt layer from the default.

Co-authored-by: Eliza Weisman <eliza@buoyant.io>
dtolnay pushed a commit to dtolnay-contrib/console that referenced this pull request Feb 4, 2022
Currently, the `console_subscriber::build()` and
`console_subscriber::init()` functions configure an `EnvFilter` that
enables the `tokio` and `runtime` targets, plus any targets configured
by `RUST_LOG`. This means that the `tokio` spans used by the console
will always be enabled at the `TRACE` level for all layers. This
includes the `fmt` layer we previously added in `init`.

Since this resulted in the `fmt` layer logs being cluttered with a bunch
of `tokio=trace` spans and events even when only high-level application
logs are enabled by `RUST_LOG`, we removed the `fmt` layer in PR console-rs#64.

However, tokio-rs/tracing#1523 was recently merged and [released][1],
adding support for [per-layer filtering][2] to `tracing-subscriber`. We
can now use the per-layer filtering API to selectively enable the
`tokio`/`runtime` spans and events at the `TRACE` level _only_ for the
`TasksLayer`, and add a filter to the `fmt` layer based on `RUST_LOG`.
This allows us to put back the `fmt` layer in
`console_subscriber::init`.

Now, if we run the example app (which uses `init`) with a `RUST_LOG`
value that enables only the app's logs, we get nice output:

![image](https://user-images.githubusercontent.com/2796466/133124582-608c2b72-db2f-4588-bb75-585312ac8d66.png)

However, we can also enable the `console-subscriber` crate's internal
logging:

![image](https://user-images.githubusercontent.com/2796466/133124746-7df10f14-cf8c-40ef-96f3-5046039a8577.png)

And, we can still enable `tokio=trace` ourselves, if we actually _want_
to see all the task spans and waker events:

![image](https://user-images.githubusercontent.com/2796466/133124851-3e4af25a-06a4-4912-9950-bfbab6dba4c7.png)

I also added some `trace!` and `debug!` macros in `examples/app.rs` to
demo that `console_subscriber::init()` also enables logging.

Closes console-rs#76
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.

3 participants