Skip to content

Conversation

@konradpabjan
Copy link
Contributor

@konradpabjan konradpabjan commented Sep 23, 2020

Resolves: https://github.com/github/c2c-actions-service/issues/1402

Improvements to action logs are now out for everyone!
https://github.blog/changelog/2020-09-23-github-actions-log-improvements/

One of the new features is proper support for 3/4 bit, 8 bit and 24 bit color. Action authors should have information about how to use this.

This PR adds some documentation to the core package README. There is some existing documentation about logging so this felt like the most logical place to add this new information. Colored output works with the normal console.log method, but it's best to document it with our core.info method.

🖌Rendered 🖼

There are a bunch of NPM packages that can be used to assist with this, but I intentionally choose to document the raw ANSI codes. Towards the end I call out one NPM package that I tested and have found to work pretty well. Some popular ones such as chalk don't work because of how they handle string prototypes.

Testing

image

Copy link
Contributor

@yacaovsnc yacaovsnc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@konradpabjan konradpabjan merged commit 2178f0b into main Sep 24, 2020
@xt0rted
Copy link
Contributor

xt0rted commented Sep 24, 2020

Do these color changes carry over to annotation messages or is it just for the log output?

@thboop thboop deleted the konradpabjan/logs-color-documentation branch May 3, 2021 19:55
@Fleshgrinder
Copy link

@xt0rted very late, but the annotations are broken if colors are used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants