add: logging

This commit is contained in:
andrew 2026-04-23 16:22:36 -04:00
parent c798e387bd
commit 04ebd38691
4 changed files with 74 additions and 10 deletions

View file

@ -3,6 +3,7 @@ use std::path::PathBuf;
use clap::Parser;
use typssg::{compile_article, compile_all};
use log::{info, error};
#[derive(Parser)]
struct Args {
@ -17,9 +18,11 @@ struct Args {
}
fn main() {
env_logger::init();
match env::current_dir() {
Ok(path) => println!("Current working directory: {}", path.display()),
Err(e) => eprintln!("Error getting current directory: {}", e),
Ok(path) => info!("Starting in working directory: {}", path.display()),
Err(e) => error!("Error getting current directory: {}", e),
}
let args = Args::parse();
@ -31,7 +34,7 @@ fn main() {
};
if let Err(e) = result {
eprintln!("{e}");
error!("{e}");
std::process::exit(1);
}
}