Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Add env-filter-explorer example#3233

Open
joshka wants to merge3 commits intotokio-rs:master
base:master
Choose a base branch
Loading
fromjoshka:jm/env-filter-explorer

Conversation

joshka
Copy link
Contributor

Motivation

Ondiscord, Conrad suggested a website to experiment with env-filter syntax. I think a TUI in tree makes a pretty decent replacement, especially as the output can exactly match the output that a real user might see if they're configuring tracing_subscriber with the default values.

Solution

This example demonstrates how to use thetracing-subscriber crate's
EnvFilter type to filter log messages based on their metadata. The
example provides a text area where users can input an environment filter
string, and displays the log messages that would be captured by that
filter.

There are preset filters that can be selected that show off the syntax.

image

The transitive dependency on itoa 0.4 does not compiles with stablerust. Bump inferno to 0.12.1 to fix this.```❯ cargo check --examples    Checking serde v1.0.157    Checking tokio v1.43.0    Checking itoa v0.4.0    Checking tracing-macros v0.1.0 (/Users/joshka/local/tracing/tracing-macros)error[E0554]: `#![feature]` may not be used on the stable release channel  --> /Users/joshka/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/itoa-0.4.0/src/lib.rs:13:31   |13 | #![cfg_attr(feature = "i128", feature(i128_type, i128))]   |                               ^^^^^^^^^^^^^^^^^^^^^^^^   |   = help: the feature `i128_type` has been stable since `1.26.0` and no longer requires an attribute to enable``````❯ cargo tree -i itoa@0.4.0itoa v0.4.0└── num-format v0.4.0    └── inferno v0.11.6        [dev-dependencies]        └── tracing-examples v0.0.0 (/Users/joshka/local/tracing/examples)```
This example demonstrates how to use the `tracing-subscriber` crate's`EnvFilter` type to filter log messages based on their metadata. Theexample provides a text area where users can input an environment filterstring, and displays the log messages that would be captured by thatfilter.
@joshkajoshka requested review fromhawkw,davidbarsky anda team ascode ownersMarch 12, 2025 20:59
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@hawkwhawkwAwaiting requested review from hawkwhawkw is a code owner

@davidbarskydavidbarskyAwaiting requested review from davidbarskydavidbarsky is a code owner

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@joshka@hds

[8]ページ先頭

©2009-2025 Movatter.jp