Skip to content

Commit

Permalink
Output cargo workspace process to stdout only
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Sep 5, 2024
1 parent b310b06 commit e5f2817
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions crates/tracel-xtask/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ macro_rules! group {
($($arg:tt)*) => {
let title = format!($($arg)*);
if std::env::var("CI").is_ok() {
eprintln!("::group::{}", title)
println!("::group::{}", title)
} else {
log!(log::Level::Info, "{}", title)
}
Expand All @@ -61,7 +61,7 @@ macro_rules! group_info {
($($arg:tt)*) => {
let title = format!($($arg)*);
if std::env::var("CI").is_ok() {
eprintln!("{}", title)
println!("{}", title)
} else {
log!(log::Level::Info, "{}", title)
}
Expand All @@ -74,7 +74,7 @@ macro_rules! endgroup {
// endgroup!()
() => {
if std::env::var("CI").is_ok() {
eprintln!("::endgroup::")
println!("::endgroup::")
}
};
}
8 changes: 2 additions & 6 deletions crates/tracel-xtask/src/utils/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub fn run_process_for_workspace<'a>(
// Process the stdout to inject log groups
let mut ignore_error = false;
let mut close_group = false;
for (line, is_stderr) in rx.iter() {
for (line, _is_stderr) in rx.iter() {
let mut skip_line = false;

if let Some(rx) = &group_rx {
Expand All @@ -137,11 +137,7 @@ pub fn run_process_for_workspace<'a>(
}

if !skip_line {
if is_stderr {
eprintln!("{}", line);
} else {
println!("{}", line);
}
println!("{}", line);
}
}

Expand Down

0 comments on commit e5f2817

Please sign in to comment.