From 877d159cf7ce5385b1e296447563bbf4a7ef41bb Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Sat, 30 Sep 2023 14:57:56 +0530 Subject: [PATCH] feat: take debug_assertions into account for tracing level --- package/action/src/main.rs | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/package/action/src/main.rs b/package/action/src/main.rs index de037c6..d6e78fe 100644 --- a/package/action/src/main.rs +++ b/package/action/src/main.rs @@ -1,23 +1,31 @@ use std::fs::File; -use action::{download::{download_release, install_lune}, fmt::LogFormatter}; +use action::{ + download::{download_release, install_lune}, + fmt::LogFormatter, +}; use actions_core as core; use tracing::Level; use tracing_unwrap::ResultExt; fn main() { + println!( + "debug mode: {}", + (core::is_debug() || cfg!(debug_assertions)) + ); + if cfg!(debug_assertions) { better_panic::install(); - } else { - tracing_subscriber::fmt() - .with_max_level(match core::is_debug() { - true => Level::DEBUG, - false => Level::INFO, - }) - .event_format(LogFormatter) - .init(); } + tracing_subscriber::fmt() + .with_max_level(match core::is_debug() || cfg!(debug_assertions) { + true => Level::DEBUG, + false => Level::INFO, + }) + .event_format(LogFormatter) + .init(); + let (zip_path, meta) = download_release().expect_or_log("failed to download latest lune release");