Skip to content

Commit

Permalink
feat: add tracing subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
thewh1teagle committed Oct 24, 2024
1 parent 7287b5a commit bdeaafd
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
clap = { version = "4.4.6", features = ["derive"] }
env_logger = { version = "0.11.3", features = ["color"] }
tracing-subscriber = "0.3.18"
lazy_static = "1.4.0"
rookie = { path = "../rookie-rs", version = "0.5.3-beta.0" }
serde_json = "1.0.107"
3 changes: 1 addition & 2 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ fn print_version() {
}

fn main() -> Result<(), Box<dyn std::error::Error>> {
tracing_subscriber::fmt::init();
let args = Args::parse();
env_logger::init();

if args.version {
print_version();
}
Expand Down
1 change: 1 addition & 0 deletions examples/rust/http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ edition = "2021"
regex = "1.9.5"
reqwest = { version = "0.11.20", features = ["blocking"] }
rookie = { path = "../../../rookie-rs", version = "0.5.3-beta.0" }
tracing-subscriber = "0.3.18"
1 change: 1 addition & 0 deletions examples/rust/http/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ fn extract_username(html: &str) -> &str {
}

fn main() -> Result<(), Box<dyn std::error::Error>> {
tracing_subscriber::fmt::init();
// Create a custom cookie store
let client = Client::new();
let cookies = load(Some(vec!["github.com".into()]))?;
Expand Down
2 changes: 1 addition & 1 deletion examples/rust/logging/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
env_logger = { version = "0.11.3", features = ["color"] }
tracing-subscriber = "0.3.18"
rookie = { path = "../../../rookie-rs", version = "0.5.3-beta.0" }
2 changes: 1 addition & 1 deletion examples/rust/logging/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
fn main() {
env_logger::init();
tracing_subscriber::fmt::init();
let cookies = rookie::brave(None).unwrap();
println!("Found {} cookies", cookies.len());
}
7 changes: 5 additions & 2 deletions examples/rust/simple.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
fn main() {
let cookies = rookie::brave(None).unwrap();
println!("Found {} cookies!", cookies.len());
tracing_subscriber::fmt::init();
let cookies = rookie::chrome(None).unwrap();
for cookie in cookies {
println!("{:?}", cookie);
}
}
3 changes: 3 additions & 0 deletions rookie-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"
url = "2"

[dev-dependencies]
tracing-subscriber = "0.3.18"

[features]
default = []
pyo3 = ["eyre/pyo3"]
Expand Down

0 comments on commit bdeaafd

Please sign in to comment.