fn main() {
println!("garjan logging example");
println!();
println!("When the 'logging' feature is enabled, garjan emits tracing events:");
println!(" - WARN on invalid parameters (sample_rate, duration)");
println!(" - ERROR on naad backend initialization failures");
println!();
println!("To see these in your application:");
println!(" 1. Add 'logging' to garjan features in Cargo.toml:");
println!(" garjan = {{ version = \"1\", features = [\"logging\"] }}");
println!(" 2. Initialize a tracing subscriber in your app's main()");
println!(" 3. Set RUST_LOG=garjan=trace (or warn/error)");
println!();
use garjan::prelude::*;
match Thunder::new(500.0, -1.0) {
Err(e) => println!("Got expected error: {e}"),
Ok(_) => unreachable!(),
}
match Wind::new(10.0, 0.5, 44100.0) {
Ok(mut w) => match w.synthesize(f32::INFINITY) {
Err(e) => println!("Got expected error: {e}"),
Ok(_) => unreachable!(),
},
Err(e) => println!("Unexpected: {e}"),
}
}