Skip to content

Commit

Permalink
Tracing bug reproduction
Browse files Browse the repository at this point in the history
  • Loading branch information
ConradIrwin committed Apr 5, 2024
0 parents commit 00a1b14
Show file tree
Hide file tree
Showing 4 changed files with 382 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
@@ -0,0 +1,8 @@
/target


# Added by cargo
#
# already existing elements were commented out

#/target
332 changes: 332 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions Cargo.toml
@@ -0,0 +1,20 @@
[package]
name = "collab"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tracing-subscriber = { version = "0.3.18", features = [
"env-filter",
"json",
"registry",
"tracing-log",
] }
tracing-core = "0.1.32"
tracing = "0.1.40"
log = "0.4.21"
[[bin]]
name = "collab"
path = "src/main.rs"
22 changes: 22 additions & 0 deletions src/main.rs
@@ -0,0 +1,22 @@
use std::str::FromStr;

use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, Layer};

fn main() {
let filter = tracing_subscriber::filter::EnvFilter::from_str("warn,collab=info").unwrap();

tracing_subscriber::registry()
.with(Box::new(
tracing_subscriber::fmt::layer().with_filter(filter),
))
.init();

let _ = log::log_enabled!(
target: "sqlx",
log::Level::Info
);

tracing::error!("ERROR");
tracing::warn!("WARN");
tracing::info!("INFO");
}

0 comments on commit 00a1b14

Please sign in to comment.