From 4a54f28a4d98f5075a253b78b4a3341b1b34c67b Mon Sep 17 00:00:00 2001 From: Serial <69764315+Serial-ATA@users.noreply.github.com> Date: Sat, 25 Oct 2025 11:34:54 -0400 Subject: [PATCH] Examples: Add env_logger Makes debugging files a lot easier --- examples/tag_reader.rs | 2 ++ examples/tag_stripper.rs | 2 ++ examples/tag_writer.rs | 2 ++ lofty/Cargo.toml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/examples/tag_reader.rs b/examples/tag_reader.rs index 66861ed61..a59cdaf82 100644 --- a/examples/tag_reader.rs +++ b/examples/tag_reader.rs @@ -6,6 +6,8 @@ use lofty::probe::Probe; use std::path::Path; fn main() { + env_logger::init(); + let path_str = std::env::args().nth(1).expect("ERROR: No path specified!"); let path = Path::new(&path_str); diff --git a/examples/tag_stripper.rs b/examples/tag_stripper.rs index 5381297b0..f6598092c 100644 --- a/examples/tag_stripper.rs +++ b/examples/tag_stripper.rs @@ -6,6 +6,8 @@ use lofty::probe::Probe; use std::io::Write; fn main() { + env_logger::init(); + let path = std::env::args().nth(1).expect("ERROR: No path specified!"); let tagged_file = Probe::open(path.as_str()) diff --git a/examples/tag_writer.rs b/examples/tag_writer.rs index 32bf2cf0c..11552bba9 100644 --- a/examples/tag_writer.rs +++ b/examples/tag_writer.rs @@ -29,6 +29,8 @@ struct Opt { } fn main() { + env_logger::init(); + let opt = Opt::from_args(); let mut tagged_file = Probe::open(&opt.path) diff --git a/lofty/Cargo.toml b/lofty/Cargo.toml index 2552234d2..a3bcb992f 100644 --- a/lofty/Cargo.toml +++ b/lofty/Cargo.toml @@ -38,6 +38,8 @@ features = ["derive"] optional = true [dev-dependencies] +# For examples +env_logger = "0.11.8" # WAV properties validity tests hound = { git = "https://github.com/ruuda/hound.git", rev = "02e66effb33683dd6acb92df792683ee46ad6a59" } rusty-fork = "0.3.0"