#![cfg_attr(
all(target_os = "windows", not(debug_assertions)),
windows_subsystem = "windows"
)]
#[cfg(target_os = "windows")]
mod app;
#[cfg(target_os = "windows")]
mod klp_client;
#[cfg(target_os = "windows")]
fn main() {
let filter = tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| "kanade_client=info".into());
let log_path = r"C:\ProgramData\Kanade\logs\client.log";
if let Some(dir) = std::path::Path::new(log_path).parent() {
let _ = std::fs::create_dir_all(dir);
}
match std::fs::OpenOptions::new()
.create(true)
.append(true)
.open(log_path)
{
Ok(file) => tracing_subscriber::fmt()
.with_env_filter(filter)
.with_ansi(false)
.with_writer(std::sync::Mutex::new(file))
.init(),
Err(_) => tracing_subscriber::fmt().with_env_filter(filter).init(),
}
app::run();
}
#[cfg(not(target_os = "windows"))]
fn main() {
eprintln!("kanade-client is Windows-only in this build (Linux UDS variant is a follow-up PR).");
std::process::exit(1);
}