Skip to content

Commit 15a780b

Browse files
committed
chore: Update log filter list and add arg to disable filter
1 parent b8fc6d3 commit 15a780b

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

src/bin/bluebuild.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,18 @@ fn main() {
88

99
Logger::new()
1010
.filter_level(args.verbosity.log_level_filter())
11-
.filter_modules([
12-
("hyper::proto", LevelFilter::Off),
13-
("hyper_util", LevelFilter::Off),
14-
("reqwest", LevelFilter::Off),
15-
("oci_client", LevelFilter::Off),
16-
("rustls", LevelFilter::Off),
17-
])
11+
.filter_modules(if args.no_log_filter {
12+
vec![]
13+
} else {
14+
vec![
15+
("hyper::proto", LevelFilter::Off),
16+
("hyper_util", LevelFilter::Off),
17+
("reqwest", LevelFilter::Off),
18+
("oci_client", LevelFilter::Off),
19+
("rustls", LevelFilter::Off),
20+
("mio", LevelFilter::Off),
21+
]
22+
})
1823
.log_out_dir(args.log_out.clone())
1924
.init();
2025
log::trace!("Parsed arguments: {args:#?}");

src/commands.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::path::PathBuf;
22

3+
use blue_build_utils::constants::BB_NO_LOG_FILTER;
34
use log::error;
45

56
use clap::{Parser, Subcommand, crate_authors};
@@ -49,6 +50,13 @@ pub struct BlueBuildArgs {
4950
#[command(subcommand)]
5051
pub command: CommandArgs,
5152

53+
/// Allows printing logs from all crates.
54+
///
55+
/// WARNING: This can print sensitive information.
56+
/// Be sure to run this in a non-public setting.
57+
#[arg(long, env = BB_NO_LOG_FILTER)]
58+
pub no_log_filter: bool,
59+
5260
/// The directory to output build logs.
5361
#[arg(long)]
5462
pub log_out: Option<PathBuf>,

utils/src/constants.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ pub const BB_GENISO_SECURE_BOOT_URL: &str = "BB_GENISO_SECURE_BOOT_URL";
4242
pub const BB_GENISO_VARIANT: &str = "BB_GENISO_VARIANT";
4343
pub const BB_GENISO_WEB_UI: &str = "BB_GENISO_WEB_UI";
4444
pub const BB_INSPECT_DRIVER: &str = "BB_INSPECT_DRIVER";
45+
pub const BB_NO_LOG_FILTER: &str = "BB_NO_LOG_FILTER";
4546
pub const BB_PASSWORD: &str = "BB_PASSWORD";
4647
pub const BB_PRIVATE_KEY: &str = "BB_PRIVATE_KEY";
4748
pub const BB_REGISTRY: &str = "BB_REGISTRY";

0 commit comments

Comments
 (0)