fn main() {
#[cfg(feature = "sentry")]
let _guard = {
let dsn = std::env::var("SENTRY_DSN").unwrap_or_default();
if !dsn.is_empty() {
match dsn.parse::<sentry::types::Dsn>() {
Ok(parsed_dsn) => {
let environment = std::env::var("SENTRY_ENVIRONMENT")
.unwrap_or_else(|_| "development".into());
let mut options = sentry::ClientOptions::new().environment(environment.clone());
if let Some(release) = sentry::release_name!() {
options = options.release(release);
}
let guard = sentry::init((parsed_dsn, options));
println!(
"Sentry initialized for error monitoring (feature enabled, env={environment})"
);
Some(guard)
}
Err(e) => {
eprintln!("Invalid SENTRY_DSN format: {}", e);
println!("Sentry feature enabled but not reporting due to invalid DSN.");
None
}
}
} else {
println!("SENTRY_DSN not set; Sentry feature enabled but not reporting.");
None
}
};
#[cfg(not(feature = "sentry"))]
{
println!("Sentry feature not enabled. Running without error reporting.");
}
use neuromod::{NeuroModulators, SpikingNetwork};
let mut network = SpikingNetwork::new();
let stimuli = [0.5f32; 16];
let modulators = NeuroModulators::default();
let _spikes = network.step(&stimuli, &modulators).expect("step failed");
println!("neuromod step completed successfully.");
}