From e81489d82bfcc3632518074786f850249cd758e1 Mon Sep 17 00:00:00 2001 From: Rune Soerensen Date: Sat, 20 Jul 2024 02:38:28 -0400 Subject: [PATCH] Reset color settings after writing body --- libherokubuildpack/src/log.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libherokubuildpack/src/log.rs b/libherokubuildpack/src/log.rs index 9e270e27..989215eb 100644 --- a/libherokubuildpack/src/log.rs +++ b/libherokubuildpack/src/log.rs @@ -14,12 +14,12 @@ pub fn log_error(header: impl AsRef, body: impl AsRef) { .set_color(ColorSpec::new().set_fg(Some(Color::Red)).set_bold(true)) .unwrap(); writeln!(&mut stream, "\n[Error: {}]", header.as_ref()).unwrap(); - stream.reset().unwrap(); stream .set_color(ColorSpec::new().set_fg(Some(Color::Red))) .unwrap(); writeln!(&mut stream, "{}", body.as_ref()).unwrap(); + stream.reset().unwrap(); stream.flush().unwrap(); } @@ -36,12 +36,12 @@ pub fn log_warning(header: impl AsRef, body: impl AsRef) { .set_color(ColorSpec::new().set_fg(Some(Color::Yellow)).set_bold(true)) .unwrap(); writeln!(&mut stream, "\n[Warning: {}]", header.as_ref()).unwrap(); - stream.reset().unwrap(); stream .set_color(ColorSpec::new().set_fg(Some(Color::Yellow))) .unwrap(); writeln!(&mut stream, "{}", body.as_ref()).unwrap(); + stream.reset().unwrap(); stream.flush().unwrap(); }