mirror of
https://github.com/CompeyDev/lune-packaging.git
synced 2025-01-09 12:19:09 +00:00
feat: take debug_assertions into account for tracing level
This commit is contained in:
parent
8de20e2c96
commit
877d159cf7
1 changed files with 17 additions and 9 deletions
|
@ -1,22 +1,30 @@
|
||||||
use std::fs::File;
|
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 actions_core as core;
|
||||||
use tracing::Level;
|
use tracing::Level;
|
||||||
use tracing_unwrap::ResultExt;
|
use tracing_unwrap::ResultExt;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
println!(
|
||||||
|
"debug mode: {}",
|
||||||
|
(core::is_debug() || cfg!(debug_assertions))
|
||||||
|
);
|
||||||
|
|
||||||
if cfg!(debug_assertions) {
|
if cfg!(debug_assertions) {
|
||||||
better_panic::install();
|
better_panic::install();
|
||||||
} else {
|
}
|
||||||
|
|
||||||
tracing_subscriber::fmt()
|
tracing_subscriber::fmt()
|
||||||
.with_max_level(match core::is_debug() {
|
.with_max_level(match core::is_debug() || cfg!(debug_assertions) {
|
||||||
true => Level::DEBUG,
|
true => Level::DEBUG,
|
||||||
false => Level::INFO,
|
false => Level::INFO,
|
||||||
})
|
})
|
||||||
.event_format(LogFormatter)
|
.event_format(LogFormatter)
|
||||||
.init();
|
.init();
|
||||||
}
|
|
||||||
|
|
||||||
let (zip_path, meta) =
|
let (zip_path, meta) =
|
||||||
download_release().expect_or_log("failed to download latest lune release");
|
download_release().expect_or_log("failed to download latest lune release");
|
||||||
|
|
Loading…
Reference in a new issue