From 3aece393069f9a57b1cc2cdc144aed2a81964dfa Mon Sep 17 00:00:00 2001 From: Lars Quentin Date: Thu, 22 Feb 2024 19:19:16 +0100 Subject: [PATCH] set up logging --- blackheap-core/Cargo.toml | 3 --- blackheap/Cargo.toml | 2 ++ blackheap/src/main.rs | 6 +++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/blackheap-core/Cargo.toml b/blackheap-core/Cargo.toml index a2bee95..641e391 100644 --- a/blackheap-core/Cargo.toml +++ b/blackheap-core/Cargo.toml @@ -3,6 +3,3 @@ name = "blackheap-core" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/blackheap/Cargo.toml b/blackheap/Cargo.toml index 716aa22..7d436a6 100644 --- a/blackheap/Cargo.toml +++ b/blackheap/Cargo.toml @@ -17,4 +17,6 @@ clap = { version = "4.5", features = ["derive"] } human-panic = "1.2" libc = "0.2" thiserror = "1.0" +tracing = "0.1" +tracing-subscriber = "0.3" uuid = { version = "1.7", features = ["v4", "fast-rng"] } diff --git a/blackheap/src/main.rs b/blackheap/src/main.rs index dd94807..1250d07 100644 --- a/blackheap/src/main.rs +++ b/blackheap/src/main.rs @@ -1,5 +1,7 @@ use crate::cli::Cli; +use tracing::info; + use clap::Parser; mod cli; @@ -7,8 +9,10 @@ mod cli; fn main() { human_panic::setup_panic!(); - let cli = Cli::parse(); + tracing_subscriber::fmt::init(); + info!("Parsing and validating CLI"); + let cli = Cli::parse(); if let Err(e) = cli::validate_cli(&cli) { println!("{:?}", e); }