You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
libherokubuildpack: Fix colour resetting for the log_* macros (#890)
This fixes some long-standing ANSI colour bugs with the `log_header`,
`log_error` and `log_warning` macros. Whilst we soon want to move away
to more advanced logging libraries that use the new logging style, there
are still many buildpacks using these macros which will benefit short
term from these fixes (Procfile, Go, Node.js, JVM, Python, PHP,
buildpacks-release-phase, buildpacks-frontend-web).
The logging macros would previously emit output roughly like:
```
<colour>
[Error: Foo]
<reset><colour>Message line one.
Message line two.
```
This was not only missing the final `<reset>`, but also didn't wrap
each line individually with colour codes/resets.
This causes issues when lines end up prefixed - such as the Git
`remote:` prefix, or when using Pack CLI locally with an untrusted build
(which adds the colourised `[builder]` prefixes) or `--timestamps` mode.
For example in this:
```
remote: <colour>
remote: [Error: Foo]
remote: <reset><colour>Message line one.
remote: Message line two.
```
...several of the `remote:`s would inherit the colours.
Instead what we need is:
```
remote:
remote: <colour>[Error: Foo]<reset>
remote: <colour>Message line one.<reset>
remote: <colour>Message line two.<reset>
```
Fixes#555.
Closes#844.
GUS-W-17400078.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
10
10
## [Unreleased]
11
11
12
+
### Fixed
13
+
14
+
-`libherokubuildpack`:
15
+
- Fixed `log_header`, `log_error` and `log_warning` to correctly reset the ANSI colour styles at the end of each line. ([#890](https://github.com/heroku/libcnb.rs/pull/890))
12
16
13
17
## [0.26.0] - 2024-11-18
14
18
15
19
### Changed
16
20
17
21
-`libherokubuildpack`:
18
-
- Removed `buildpack_output` module. This functionality from ([#721](https://github.com/heroku/libcnb.rs/pull/721)) was experimental. The API was not stable and it is being removed. A similar API is available at [bullet_stream](https://crates.io/crates/bullet_stream). ([#852](https://github.com/heroku/libcnb.rs/pull/852)
22
+
- Removed `buildpack_output` module. This functionality from ([#721](https://github.com/heroku/libcnb.rs/pull/721)) was experimental. The API was not stable and it is being removed. A similar API is available at [bullet_stream](https://crates.io/crates/bullet_stream). ([#852](https://github.com/heroku/libcnb.rs/pull/852))
0 commit comments