pub mod actions;
pub mod app;
pub mod components;
pub mod events;
pub mod headless;
pub mod theme;
pub mod ui;
pub mod widgets;
use anyhow::Result;
use std::path::Path;
use tracing_subscriber::{EnvFilter, Layer, fmt, prelude::*};
pub fn initialize_logging() -> Result<()> {
std::fs::create_dir_all("/tmp/codediff")?;
let path = Path::new("/tmp/codediff/log.txt");
let log_file = std::fs::File::create(path)?;
let env_filter = EnvFilter::builder()
.with_default_directive(tracing::Level::INFO.into())
.from_env_lossy();
let file_subscriber = fmt::layer()
.with_file(true)
.with_line_number(true)
.with_writer(log_file)
.with_target(false)
.with_ansi(false)
.with_filter(env_filter);
tracing_subscriber::registry()
.with(file_subscriber)
.with(tracing_error::ErrorLayer::default())
.try_init()?;
Ok(())
}