-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
50 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters