25 lines
673 B
Rust
25 lines
673 B
Rust
use joecalsend::{Config, error, models::Device};
|
|
use local_ip_address::local_ip;
|
|
use tui_logger::{LevelFilter, init_logger, set_env_filter_from_env};
|
|
|
|
mod app;
|
|
|
|
fn main() -> error::Result<()> {
|
|
let device = Device::default();
|
|
|
|
if std::env::var("RUST_LOG").is_err() {
|
|
unsafe {
|
|
std::env::set_var("RUST_LOG", "joecalsend");
|
|
}
|
|
}
|
|
init_logger(LevelFilter::Debug).map_err(|e| std::io::Error::other(format!("{e}")))?;
|
|
set_env_filter_from_env(None);
|
|
|
|
let config = Config::default();
|
|
|
|
let mut terminal = ratatui::init();
|
|
let result = app::start_and_run(&mut terminal, config, device);
|
|
ratatui::restore();
|
|
|
|
result
|
|
}
|