Skip to content

Commit 562fcc8

Browse files
committed
fix(provider): print all lines with the github actions prefix when logging
1 parent b5907c4 commit 562fcc8

1 file changed

Lines changed: 11 additions & 17 deletions

File tree

src/ci_provider/github_actions/logger.rs

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,17 @@ impl Log for GithubActionLogger {
2828
return;
2929
}
3030

31-
match level {
32-
Level::Error => {
33-
println!("::error::{}", message);
34-
}
35-
Level::Warn => {
36-
println!("::warning::{}", message);
37-
}
38-
Level::Info => {
39-
println!("{}", message);
40-
}
41-
Level::Debug => {
42-
println!("::debug::{}", message);
43-
}
44-
Level::Trace => {
45-
println!("::debug::[TRACE]{}", message);
46-
}
47-
}
31+
let prefix = match level {
32+
Level::Error => "::error::",
33+
Level::Warn => "::warning::",
34+
Level::Info => "",
35+
Level::Debug => "::debug::",
36+
Level::Trace => "::debug::[TRACE]",
37+
};
38+
let message_string = message.to_string();
39+
let lines = message_string.lines();
40+
// ensure that all the lines of the message have the prefix, otherwise GitHub Actions will not recognize the command for the whole string
41+
lines.for_each(|line| println!("{}{}", prefix, line));
4842
}
4943

5044
fn flush(&self) {}

0 commit comments

Comments
 (0)