-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rainbowprint): Introduce colorful log prefixing #1007
Merged
Merged
Conversation
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
Currently based on top of #984 |
LucaSeri
force-pushed
the
rainbow-print
branch
from
November 15, 2023 13:59
9a8e35c
to
7174831
Compare
nderjung
reviewed
Nov 15, 2023
nderjung
reviewed
Nov 15, 2023
nderjung
reviewed
Nov 15, 2023
nderjung
reviewed
Nov 15, 2023
nderjung
reviewed
Nov 15, 2023
LucaSeri
force-pushed
the
rainbow-print
branch
2 times, most recently
from
November 20, 2023 08:51
62255c9
to
a05048e
Compare
LucaSeri
force-pushed
the
rainbow-print
branch
2 times, most recently
from
November 23, 2023 14:19
236bfd4
to
cbe24b7
Compare
4 tasks
This commit imports a customized colored text generator from [0] verbatim and with LICENSE attribution. The purpose for importing is to be able to make adjustments whilst retaining base functionality. [0]: https://github.com/docker/compose/blob/df70735/cmd/formatter/colors.go Signed-off-by: Luca Seritan <luca.seritan@gmail.com>
Get rid of init in favour of lazily initializing all the colors when they are first requested. Signed-off-by: Luca Seritan <luca.seritan@gmail.com>
This commit introduces a generic log consumer interface with a single implementation which can be used to prefix all logs with a colorful annotation. Signed-off-by: Luca Seritan <luca.seritan@gmail.com>
LucaSeri
force-pushed
the
rainbow-print
branch
from
January 8, 2024 16:08
cbe24b7
to
52476eb
Compare
Thanks @nderjung! This is now ready for any final review 🚀 |
nderjung
reviewed
Jan 8, 2024
Introduce the option to prepend all logs with a colorful prefix that can help distinguish between log streams. Signed-off-by: Luca Seritan <luca.seritan@gmail.com>
Introduce the option to prepend all logs with a colorful prefix that can help distinguish between log streams. Signed-off-by: Luca Seritan <luca.seritan@gmail.com>
LucaSeri
force-pushed
the
rainbow-print
branch
from
January 8, 2024 17:06
52476eb
to
e3a2e8a
Compare
nderjung
approved these changes
Jan 9, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisite checklist
make fmt
on your commit series before opening this PR;Description of changes
This PR introduces the
rainbowprint
internal library that can be used to generate ANSI color codes. The library is used forkraft run
andkraft log
to optionally prefix all the logs with a colorful string, which is useful when looking at a stream generated by multiple unikernels:kraft run --prefix "soo colorful" unikraft.org/helloworld:latest --plat qemu --arch x86_64