organic/src/main.rs

25 lines
619 B
Rust
Raw Normal View History

use organic::parse_cli::main_body;
#[cfg(feature = "tracing")]
2023-04-11 15:08:46 -04:00
use crate::init_tracing::init_telemetry;
#[cfg(feature = "tracing")]
2023-04-11 15:08:46 -04:00
use crate::init_tracing::shutdown_telemetry;
#[cfg(feature = "tracing")]
2023-04-11 15:08:46 -04:00
mod init_tracing;
2022-07-15 23:26:49 -04:00
#[cfg(not(feature = "tracing"))]
2022-07-15 23:26:49 -04:00
fn main() -> Result<(), Box<dyn std::error::Error>> {
main_body()
}
#[cfg(feature = "tracing")]
fn main() -> Result<(), Box<dyn std::error::Error>> {
let rt = tokio::runtime::Runtime::new()?;
2023-10-16 19:12:25 -04:00
rt.block_on(async {
init_telemetry()?;
let main_body_result = main_body();
shutdown_telemetry()?;
main_body_result
2023-10-16 19:12:25 -04:00
})
}